Bug 60903 - [4.8 Regression] ICE: in verify_loop_structure, at cfgloop.c:1647: : edge from 13 to 14 should be marked irreducible
Summary: [4.8 Regression] ICE: in verify_loop_structure, at cfgloop.c:1647: : edge fro...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: 4.8.3
Assignee: Richard Biener
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-04-20 08:59 UTC by Zdenek Sojka
Modified: 2014-05-06 09:02 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.10.0, 4.7.4, 4.8.3, 4.9.1
Known to fail: 4.8.2, 4.9.0
Last reconfirmed: 2014-04-22 00:00:00


Attachments
reduced testcase (116 bytes, text/x-csrc)
2014-04-20 08:59 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2014-04-20 08:59:01 UTC
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
Comment 1 Richard Biener 2014-04-22 08:49:53 UTC
I will have a look.
Comment 2 Richard Biener 2014-04-23 09:17:38 UTC
LIM is the culprit - it does CFG building but those don't properly update
BB/EDGE_IRREDUCIBLE_LOOP.
Comment 3 Richard Biener 2014-04-23 11:25:59 UTC
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
Comment 4 Richard Biener 2014-04-23 11:28:00 UTC
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
Comment 5 Richard Biener 2014-05-06 09:02:21 UTC
Fixed.
Comment 6 Richard Biener 2014-05-06 09:02:41 UTC
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