re PR tree-optimization/72772 (Missed SCEV after pass reordering@236440)
authorRichard Biener <rguenther@suse.de>
Thu, 11 Aug 2016 09:02:04 +0000 (09:02 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 11 Aug 2016 09:02:04 +0000 (09:02 +0000)
2016-08-11  Richard Biener  <rguenther@suse.de>

PR tree-optimization/72772
* cfgloopmanip.c (create_preheader): Use split_edge if there
is a single loop entry, avoiding degenerate PHIs.

* gcc.dg/graphite/pr35356-1.c: Adjust.
* gcc.dg/tree-ssa/pr59597.c: Likewise.

From-SVN: r239357

gcc/ChangeLog
gcc/cfgloopmanip.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr35356-1.c
gcc/testsuite/gcc.dg/tree-ssa/pr59597.c

index d8c65cf3e104c5c7a40ceb7b8712f30e573b912a..4984f50d51d46f0ec550991295b906e8d50209fd 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/72772
+       * cfgloopmanip.c (create_preheader): Use split_edge if there
+       is a single loop entry, avoiding degenerate PHIs.
+
 2016-08-11  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-threadbackward.c (pass_data_thread_jumps): Remove
index 20476d70459dc3e68ce4fa27c92f917139dcbcab..487b91df0e5dfa4ade3ff79b478081634ec100d3 100644 (file)
@@ -1497,7 +1497,7 @@ has_preds_from_loop (basic_block block, struct loop *loop)
 basic_block
 create_preheader (struct loop *loop, int flags)
 {
-  edge e, fallthru;
+  edge e;
   basic_block dummy;
   int nentry = 0;
   bool irred = false;
@@ -1544,9 +1544,14 @@ create_preheader (struct loop *loop, int flags)
 
   mfb_kj_edge = loop_latch_edge (loop);
   latch_edge_was_fallthru = (mfb_kj_edge->flags & EDGE_FALLTHRU) != 0;
-  fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL);
-  dummy = fallthru->src;
-  loop->header = fallthru->dest;
+  if (nentry == 1)
+    dummy = split_edge (single_entry);
+  else
+    {
+      edge fallthru = make_forwarder_block (loop->header, mfb_keep_just, NULL);
+      dummy = fallthru->src;
+      loop->header = fallthru->dest;
+    }
 
   /* Try to be clever in placing the newly created preheader.  The idea is to
      avoid breaking any "fallthruness" relationship between blocks.
index 7bca99a8b3b723c1832177fa59f33cc7d8022cd8..00cdc8f6ae09af7c96ddb84ce1bf5f8af872974b 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-11  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/72772
+       * gcc.dg/graphite/pr35356-1.c: Adjust.
+       * gcc.dg/tree-ssa/pr59597.c: Likewise.
+
 2016-08-11  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * gfortran.dg/random_7.f90: Take into account that the last seed
index 649302b049e4dadb075055b17e7d2002ed4c92f9..9b633d27a37b74b432f37fb219b3edab9a8584a7 100644 (file)
@@ -34,4 +34,4 @@ if (n >= k + 1 && k >= 0) {
 
 */
 
-/* { dg-final { scan-tree-dump "if \\\(P_9 >= P_10 \\\+ 1 && P_10 >= 0\\\) \\\{" "graphite" } } */
+/* { dg-final { scan-tree-dump "if \\\(P_8 >= P_9 \\\+ 1 && P_9 >= 0\\\) \\\{" "graphite" } } */
index b7760167f04ff8bd28d0b0a7f04a43c063f34be3..4ac12c8c15cf47f1bb61e57835f02c7bd3dd41f7 100644 (file)
@@ -54,5 +54,6 @@ main (int argc, char argv[])
   return crc;
 }
 
-/* { dg-final { scan-tree-dump "Cancelling" "vrp1" } } */
-
+/* { dg-final { scan-tree-dump-times "Registering jump thread" 3 "vrp1" } } */
+/* { dg-final { scan-tree-dump-not "joiner" "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 3 "vrp1" } } */