]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR tree-optimization/59221
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 19:45:16 +0000 (19:45 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 19:45:16 +0000 (19:45 +0000)
* tree-ssa-threadedge.c (thread_across_edge): Properly manage
temporary equivalences when threading through joiner blocks.

PR tree-optimization/59221
* gcc.c-torture/execute/pr59221.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205229 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr59221.c [new file with mode: 0644]
gcc/tree-ssa-threadedge.c

index a16ae684f91467382d2dd68bbdc08845a2ad9909..e63255845bd37457c68c109e7d18923772e8d6f1 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-21  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/59221
+       * tree-ssa-threadedge.c (thread_across_edge): Properly manage
+       temporary equivalences when threading through joiner blocks.
+
 2013-11-21  Joseph Myers  <joseph@codesourcery.com>
 
        PR rtl-optimization/55950
index b29070fb11fd4127bf55796dd3f45534371f2841..0b3f8ba9b79c759fa360231a56d1fcaa02532e89 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-21  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/59221
+       * gcc.c-torture/execute/pr59221.c: New test.
+
 2013-11-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR libfortran/59227
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr59221.c b/gcc/testsuite/gcc.c-torture/execute/pr59221.c
new file mode 100644 (file)
index 0000000..0cd4259
--- /dev/null
@@ -0,0 +1,19 @@
+
+
+int a = 1, b, d;
+short e;
+
+int
+main ()
+{
+  for (; b; b++)
+    ;
+  short f = a;
+  int g = 15;
+  e = f ? f : 1 << g;
+  int h = e;
+  d = h == 83647 ? 0 : h;
+  if (d != 1)
+    __builtin_abort ();
+  return 0;
+}
index 7bb8829e5cc79b3dfab9845184cfe1193f73728e..a1448757ead784e1cacc10c0981d291e2eb98ad1 100644 (file)
@@ -1072,6 +1072,10 @@ thread_across_edge (gimple dummy_cond,
     /* Look at each successor of E->dest to see if we can thread through it.  */
     FOR_EACH_EDGE (taken_edge, ei, e->dest->succs)
       {
+       /* Push a fresh marker so we can unwind the equivalences created
+          for each of E->dest's successors.  */
+       stack->safe_push (NULL_TREE);
+     
        /* Avoid threading to any block we have already visited.  */
        bitmap_clear (visited);
        bitmap_set_bit (visited, taken_edge->dest->index);
@@ -1118,6 +1122,9 @@ thread_across_edge (gimple dummy_cond,
          {
            delete_jump_thread_path (path);
          }
+
+       /* And unwind the equivalence table.  */
+       remove_temporary_equivalences (stack);
       }
     BITMAP_FREE (visited);
   }