tree-ssa-threadedge.c (thread_across_edge): Fix initialization of 'found'.
authorJeff Law <law@redhat.com>
Mon, 9 Sep 2013 03:07:28 +0000 (21:07 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 9 Sep 2013 03:07:28 +0000 (21:07 -0600)
       * tree-ssa-threadedge.c (thread_across_edge): Fix initialization
        of 'found'.

        * gcc.c-torture/compile/pr58340.c: New test.

From-SVN: r202379

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

index 6f3e0b8a9f8af075603f7e33d28d8d72cae33f89..c7ac8f092c81aafbbd5cb29626dc389ea68b866b 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-08  Jeff Law  <law@redhat.com>
+
+       PR bootstrap/58340
+       * tree-ssa-threadedge.c (thread_across_edge): Fix initialization
+       of 'found'.
+
 2013-09-08  Andi Kleen  <ak@linux.intel.com>
 
        * tree-inline.c (estimate_num_insns): Limit asm cost to 1000.
index 92eaeabd03e8b97e985b10edb8220d2852163ad7..756611dc80c18c9f6ed7732b9ad9ec180afba8f6 100644 (file)
@@ -1,3 +1,7 @@
+2013-09-08  Jeff Law  <law@redhat.com>
+
+       * gcc.c-torture/compile/pr58340.c: New test.
+
 2013-09-08  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * g++.dg/debug/ra1.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr58340.c b/gcc/testsuite/gcc.c-torture/compile/pr58340.c
new file mode 100644 (file)
index 0000000..ca3ccda
--- /dev/null
@@ -0,0 +1,16 @@
+int a, b, c, d;
+
+int foo (int x, int y)
+{
+  return y == 0 ? x : 1 % y;
+}
+
+int main ()
+{
+  c = 0 || a;
+
+  for (;;)
+    b = foo (d, c) && 1;
+
+  return 0;
+}
index afdd0afe6d6af78ef97ba379bd448575e14b6a24..f2051d7e7d00f271152a2153b1e6925ec035e71f 100644 (file)
@@ -978,7 +978,7 @@ thread_across_edge (gimple dummy_cond,
   {
     edge taken_edge;
     edge_iterator ei;
-    bool found = false;
+    bool found;
     bitmap visited = BITMAP_ALLOC (NULL);
 
     /* Look at each successor of E->dest to see if we can thread through it.  */
@@ -994,6 +994,7 @@ thread_across_edge (gimple dummy_cond,
           of E->dest.  */
        path.safe_push (e);
        path.safe_push (taken_edge);
+       found = false;
        if ((e->flags & EDGE_DFS_BACK) == 0
            || ! cond_arg_set_in_bb (path[path.length () - 1], e->dest))
          found = thread_around_empty_blocks (taken_edge,