Created attachment 32636 [details] reduced testcase Compiler output: $ gcc -Os -fno-tree-copy-prop -ftree-loop-distribute-patterns -fno-tree-scev-cprop --param=allow-store-data-races=0 testcase.c testcase.c: In function 'foo': testcase.c:4:1: error: edge from 13 to 14 should be marked irreducible foo () ^ testcase.c:4:1: error: basic block 14 should be marked irreducible testcase.c:4:1: error: edge from 14 to 12 should be marked irreducible testcase.c:4:1: internal compiler error: in verify_loop_structure, at cfgloop.c:1647 0x762369 verify_loop_structure() /mnt/svn/gcc-trunk/gcc/cfgloop.c:1647 0xbb2c32 execute /mnt/svn/gcc-trunk/gcc/tree-loop-distribution.c:1821 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ gcc -v Using built-in specs. COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-209530-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df --enable-languages=c,c++,lto,fortran --prefix=/mnt/svn/gcc-trunk/binary-209530-lto-fortran-checking-yes-rtl-df/ --without-cloog --without-ppl Thread model: posix gcc version 4.10.0 20140419 (experimental) (GCC) Tested revisions: r209530 - ICE 4.9 r209346 - ICE 4.8 r209342 - ICE 4.7 r209345 - OK
I will have a look.
LIM is the culprit - it does CFG building but those don't properly update BB/EDGE_IRREDUCIBLE_LOOP.
Author: rguenth Date: Wed Apr 23 11:25:27 2014 New Revision: 209694 URL: http://gcc.gnu.org/viewcvs?rev=209694&root=gcc&view=rev Log: 2014-04-23 Richard Biener <rguenther@suse.de> PR tree-optimization/60903 * tree-ssa-loop-im.c (analyze_memory_references): Remove commented code block. (execute_sm_if_changed): Properly apply IRREDUCIBLE_LOOP loop flags to newly created BBs and edges. * gcc.dg/torture/pr60903.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr60903.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-im.c
Author: rguenth Date: Wed Apr 23 11:27:29 2014 New Revision: 209695 URL: http://gcc.gnu.org/viewcvs?rev=209695&root=gcc&view=rev Log: 2014-04-23 Richard Biener <rguenther@suse.de> PR tree-optimization/60903 * tree-ssa-loop-im.c (analyze_memory_references): Remove commented code block. (execute_sm_if_changed): Properly apply IRREDUCIBLE_LOOP loop flags to newly created BBs and edges. * gcc.dg/torture/pr60903.c: New testcase. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr60903.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/tree-ssa-loop-im.c
Fixed.
Author: rguenth Date: Tue May 6 09:02:08 2014 New Revision: 210099 URL: http://gcc.gnu.org/viewcvs?rev=210099&root=gcc&view=rev Log: 2014-05-06 Richard Biener <rguenther@suse.de> Backport from mainline 2014-04-17 Richard Biener <rguenther@suse.de> PR middle-end/60849 * tree-ssa-propagate.c (valid_gimple_rhs_p): Only allow effective boolean results for comparisons. * g++.dg/opt/pr60849.C: New testcase. 2014-04-07 Richard Biener <rguenther@suse.de> PR tree-optimization/60766 * tree-ssa-loop-ivopts.c (cand_value_at): Compute in an unsigned type. (may_eliminate_iv): Convert cand_value_at result to desired type. * gcc.dg/torture/pr60766.c: New testcase. 2014-04-23 Richard Biener <rguenther@suse.de> PR tree-optimization/60903 * tree-ssa-loop-im.c (execute_sm_if_changed): Properly apply IRREDUCIBLE_LOOP loop flags to newly created BBs and edges. * gcc.dg/torture/pr60903.c: New testcase. Added: branches/gcc-4_8-branch/gcc/testsuite/g++.dg/opt/pr60849.C branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr60766.c branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr60903.c Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/testsuite/ChangeLog branches/gcc-4_8-branch/gcc/tree-ssa-loop-im.c branches/gcc-4_8-branch/gcc/tree-ssa-loop-ivopts.c branches/gcc-4_8-branch/gcc/tree-ssa-propagate.c