diff options
author | Richard Biener <rguenther@suse.de> | 2016-03-07 17:01:54 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-03-07 10:01:54 -0700 |
commit | a84a49b7e7ac9b6f576508aa0683a4f14cb44f7d (patch) | |
tree | 705e817ab10e9dde6d04bbbf7f189860002d06c1 /gcc/cfgloop.h | |
parent | 55a82b661e036bab010d916f5bb60c0b6d279f3c (diff) | |
download | gcc-a84a49b7e7ac9b6f576508aa0683a4f14cb44f7d.zip gcc-a84a49b7e7ac9b6f576508aa0683a4f14cb44f7d.tar.gz gcc-a84a49b7e7ac9b6f576508aa0683a4f14cb44f7d.tar.bz2 |
re PR tree-optimization/69740 (gcc ICE at -O2 and above on valid code on x86_64-linux-gnu in "verify_loop_structure")
PR tree-optimization/69740
* cfghooks.c (remove_edge): Request loop fixups if we delete
an edge that might turn an irreducible loop into a natural
loop.
* cfgloop.h (check_verify_loop_structure): Clear LOOPS_NEED_FIXUP.
Move after definition of loops_state_clear.
PR tree-optimization/69740
* gcc.c-torture/compile/pr69740-1.c: New test.
* gcc.c-torture/compile/pr69740-2.c: New test.
Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r234036
Diffstat (limited to 'gcc/cfgloop.h')
-rw-r--r-- | gcc/cfgloop.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 882861c..54e738f 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -314,16 +314,6 @@ extern void delete_loop (struct loop *); extern void verify_loop_structure (void); -/* Check loop structure invariants, if internal consistency checks are - enabled. */ - -static inline void -checking_verify_loop_structure (void) -{ - if (flag_checking) - verify_loop_structure (); -} - /* Loop analysis. */ extern bool just_once_each_iteration_p (const struct loop *, const_basic_block); gcov_type expected_loop_iterations_unbounded (const struct loop *); @@ -546,6 +536,28 @@ loops_state_clear (unsigned flags) loops_state_clear (cfun, flags); } +/* Check loop structure invariants, if internal consistency checks are + enabled. */ + +static inline void +checking_verify_loop_structure (void) +{ + /* VERIFY_LOOP_STRUCTURE essentially asserts that no loops need fixups. + + The loop optimizers should never make changes to the CFG which + require loop fixups. But the low level CFG manipulation code may + set the flag conservatively. + + Go ahead and clear the flag here. That avoids the assert inside + VERIFY_LOOP_STRUCTURE, and if there is an inconsistency in the loop + structures VERIFY_LOOP_STRUCTURE will detect it. + + This also avoid the compile time cost of excessive fixups. */ + loops_state_clear (LOOPS_NEED_FIXUP); + if (flag_checking) + verify_loop_structure (); +} + /* Loop iterators. */ /* Flags for loop iteration. */ |