re PR rtl-optimization/85455 (ICE in verify_loop_structure, at cfgloop.c:1708 (error...
authorRichard Biener <rguenther@suse.de>
Thu, 19 Apr 2018 13:53:06 +0000 (13:53 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 19 Apr 2018 13:53:06 +0000 (13:53 +0000)
2018-04-19  Richard Biener  <rguenther@suse.de>

PR middle-end/85455
* cfg.c (clear_bb_flags): When loop state says we have
marked irreducible regions also preserve BB_IRREDUCIBLE_LOOP.

* gcc.dg/pr85455.c: New testcase.

From-SVN: r259494

gcc/ChangeLog
gcc/cfg.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr85455.c [new file with mode: 0644]

index 12c2ec10263745d1ab92e8f613e6862f72d9ad5c..3331e6ddecbaf58a8351e687e5472687f47f8a66 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-19  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/85455
+       * cfg.c (clear_bb_flags): When loop state says we have
+       marked irreducible regions also preserve BB_IRREDUCIBLE_LOOP.
+
 2018-04-19  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/84737
index 808d5870e77ce5aaf87da6728ece6b8495d78264..11026e7209a81e9970c7dabe5ea0d39c51234ecc 100644 (file)
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -386,9 +386,13 @@ void
 clear_bb_flags (void)
 {
   basic_block bb;
+  int flags_to_preserve = BB_FLAGS_TO_PRESERVE;
+  if (current_loops
+      && loops_state_satisfies_p (cfun, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS))
+    flags_to_preserve |= BB_IRREDUCIBLE_LOOP;
 
   FOR_ALL_BB_FN (bb, cfun)
-    bb->flags &= BB_FLAGS_TO_PRESERVE;
+    bb->flags &= flags_to_preserve;
 }
 \f
 /* Check the consistency of profile information.  We can't do that
index 018c6b54d3d2b9b319b86ff52adfed83d2866926..63f2be96f8df4482472a8bd8ae18e486cd56e452 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-19  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/85455
+       * gcc.dg/pr85455.c: New testcase.
+
 2018-04-19  Christophe Lyon  <christophe.lyon@linaro.org>
 
        * g++.dg/lto/pr85405_0.C: Require shared and fpic effective
diff --git a/gcc/testsuite/gcc.dg/pr85455.c b/gcc/testsuite/gcc.dg/pr85455.c
new file mode 100644 (file)
index 0000000..2028566
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fthread-jumps -fno-tree-dominator-opts -fno-tree-reassoc -fno-tree-sink -fno-tree-slsr" } */
+
+void
+ty (void);
+
+void
+um (void);
+
+void
+au (int qj)
+{
+  if (qj < 1)
+    {
+vq:
+      ty ();
+    }
+
+  um ();
+
+  goto vq;
+}