OSDN Git Service

gcc/
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Jan 2009 18:23:21 +0000 (18:23 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Jan 2009 18:23:21 +0000 (18:23 +0000)
PR tree-optimization/39007
* tree-loop-distribution.c (generate_builtin): Use
recompute_dominator to compute the immediate dominator of the
basic block just after the loop.

gcc/testsuite/
PR tree-optimization/39007
* gcc.dg/tree-ssa/pr39007.c: New.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr39007.c [new file with mode: 0644]
gcc/tree-loop-distribution.c

index a7fc861..1194f97 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-29  Kazu Hirata  <kazu@codesourcery.com>
+
+       PR tree-optimization/39007
+       * tree-loop-distribution.c (generate_builtin): Use
+       recompute_dominator to compute the immediate dominator of the
+       basic block just after the loop.
+
 2008-01-29  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * config/i386/sol2-10.h [!HAVE_AS_IX86_DIFF_SECT_DELTA]
index 942a033..a52ad85 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-29  Kazu Hirata  <kazu@codesourcery.com>
+
+       PR tree-optimization/39007
+       * gcc.dg/tree-ssa/pr39007.c: New.
+
 2009-01-29  Kenneth Zadeck <zadeck@naturalbridge.com>
 
        PR middle-end/35854
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c b/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c
new file mode 100644 (file)
index 0000000..94b2443
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+void
+foo (int *__restrict__ p, int *__restrict__ q, int count)
+{
+  int i;
+  for (i = 0; i < count; i++)
+    {
+      *p++ = 0;
+      *q++ = 0;
+    }
+}
index 1463bee..8eca7c0 100644 (file)
@@ -439,11 +439,13 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
       basic_block dest = single_exit (loop)->dest;
       prop_phis (dest);
       make_edge (src, dest, EDGE_FALLTHRU);
-      set_immediate_dominator (CDI_DOMINATORS, dest, src);
       cancel_loop_tree (loop);
 
       for (i = 0; i < nbbs; i++)
        delete_basic_block (bbs[i]);
+
+      set_immediate_dominator (CDI_DOMINATORS, dest,
+                              recompute_dominator (CDI_DOMINATORS, dest));
     }
 
  end: