Bug 47355 - [4.6 Regression] ICE: verify_ssa failed with -O2 -fipa-cp-clone
Summary: [4.6 Regression] ICE: verify_ssa failed with -O2 -fipa-cp-clone
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-19 01:41 UTC by Roman Kononov
Modified: 2011-01-21 15:39 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2011-01-19 03:59:10


Attachments
"reduced" test case (34 bytes, text/x-c++src)
2011-01-19 01:41 UTC, Roman Kononov
Details
this is the real test case; ignore the other one please (1.32 KB, text/x-c++src)
2011-01-19 01:45 UTC, Roman Kononov
Details
more reduced testcase (198 bytes, text/plain)
2011-01-19 13:27 UTC, Zdenek Sojka
Details
gcc46-pr47355.patch (663 bytes, patch)
2011-01-20 10:45 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kononov 2011-01-19 01:41:24 UTC
Created attachment 23025 [details]
"reduced" test case

$ g++ -c -std=c++0x -O2 -fipa-cp-clone test.cpp             
test.cpp: In function 'vector<green> function()':
test.cpp:200:15: error: definition in block 29 does not dominate use in block 28
test.cpp:200:15: error: no immediate_use list
for SSA_NAME: D.2314_94 in statement:
# .MEM_135 = VDEF <.MEM_109>
zfree (D.2314_94);
test.cpp:200:15: internal compiler error: verify_ssa failed
...
Comment 1 Roman Kononov 2011-01-19 01:45:20 UTC
Created attachment 23026 [details]
this is the real test case; ignore the other one please
Comment 2 H.J. Lu 2011-01-19 03:59:10 UTC
It is caused by revision 162911:

http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00122.html
Comment 3 Martin Jambor 2011-01-19 12:48:57 UTC
From what I have seen, it's pass_cleanup_eh removing an SSA
(names$_storage_94) name that is still being referenced in the IL (as
a parameter to zfree).
Comment 4 Zdenek Sojka 2011-01-19 13:27:34 UTC
Created attachment 23029 [details]
more reduced testcase

$ gcc -O -fipa-cp -fipa-cp-clone testcase.C
testcase.C: In function 'void foo()':
testcase.C:30:1: error: definition in block 15 does not dominate use in block 14
testcase.C:30:1: error: no immediate_use list
for SSA_NAME: D.2189_30 in statement:
names$_storage_26 = D.2189_30 + D.2160_19;
testcase.C:30:1: internal compiler error: verify_ssa failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(r168850, x86_64-linux)
Comment 5 Jakub Jelinek 2011-01-20 10:45:43 UTC
Created attachment 23042 [details]
gcc46-pr47355.patch

Untested fix.  Seems ehcleanup assumes nop is used just in the following phi and not somewhere else, because it doesn't attempt to rename it.  I'll see with this patch how much it triggers during bootstraps/regtests.  We can't just replace the other uses in this case, because it is changed in the loop.
Comment 6 Jakub Jelinek 2011-01-21 15:15:42 UTC
Author: jakub
Date: Fri Jan 21 15:15:40 2011
New Revision: 169094

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169094
Log:
	PR tree-optimization/47355
	* tree-eh.c (cleanup_empty_eh_merge_phis): Give up if
	NOP has non-debug uses beyond PHIs in new_bb.

	* g++.dg/opt/pr47355.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/opt/pr47355.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-eh.c
Comment 7 Jakub Jelinek 2011-01-21 15:39:49 UTC
Fixed.