From: Richard Biener Date: Thu, 19 Apr 2018 13:53:06 +0000 (+0000) Subject: re PR rtl-optimization/85455 (ICE in verify_loop_structure, at cfgloop.c:1708 (error... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca98e4c5d0e87b5305ab30591509ffc64300abd4;p=gcc.git re PR rtl-optimization/85455 (ICE in verify_loop_structure, at cfgloop.c:1708 (error: basic block 3 should be marked irreducible)) 2018-04-19 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12c2ec10263..3331e6ddecb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-19 Richard Biener + + 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 PR tree-optimization/84737 diff --git a/gcc/cfg.c b/gcc/cfg.c index 808d5870e77..11026e7209a 100644 --- 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; } /* Check the consistency of profile information. We can't do that diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 018c6b54d3d..63f2be96f8d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-19 Richard Biener + + PR middle-end/85455 + * gcc.dg/pr85455.c: New testcase. + 2018-04-19 Christophe Lyon * 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 index 00000000000..20285663332 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr85455.c @@ -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; +}