I get the following ICE with gcc 4.2. gcc 4.0 and 4.1 work. (sid)65:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/g++ -c -O min4.c min4.c: In constructor 'ConfLexerCore::ConfLexerCore(ConfIO*)': min4.c:86: error: invalid operand to unary operator &thisD.2456_2->m_matchStartD.2447; min4.c:86: internal compiler error: verify_stmts failed Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. zsh: exit 1 /usr/lib/gcc-snapshot/bin/g++ -c -O min4.c (sid)66:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/g++ -c min4.c (sid)67:tbm@usurper: ~] g++-4.1 -c -O2 min4.c (sid)68:tbm@usurper: ~] g++-4.0 -c -O2 min4.c (sid)69:tbm@usurper: ~] g++-3.4 -c -O2 min4.c (sid)70:tbm@usurper: ~]
Created attachment 11809 [details] test case
Confirmed. Reduced testcase: struct iterator{}; struct ByteIterator : iterator { ByteIterator (){} int a[1024]; }; inline ByteIterator f () { return ByteIterator (); } class ConfLexerCore { ConfLexerCore (); ByteIterator m_matchStart; }; ConfLexerCore::ConfLexerCore () : m_matchStart (f ()) { }
It rejects the valid code and ices during error-recovery.
Ah no, verify_stmts uses error ().
We have (struct iteratorD.1984 *) &thisD.2040_1->m_matchStartD.2038 after inlining, which is non-gimple. (gdb) call debug_tree (*tp) <nop_expr 0xb7e512e0 type <pointer_type 0xb7e498fc type <record_type 0xb7e49450 iterator type_1 type_5 QI size <integer_cst 0xb7d911e0 constant invariant 8> unit size <integer_cst 0xb7d911f8 constant invariant 1> align 8 symtab 0 alias set -1 fields <type_decl 0xb7e199c0 iterator> X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this <pointer_type 0xb7e498fc> chain <type_decl 0xb7e19958 iterator>> unsigned SI size <integer_cst 0xb7d913d8 constant invariant 32> unit size <integer_cst 0xb7d91168 constant invariant 4> align 32 symtab 0 alias set -1> readonly arg 0 <addr_expr 0xb7e51300 type <pointer_type 0xb7e49678 type <record_type 0xb7e49564 ByteIterator> public unsigned SI size <integer_cst 0xb7d913d8 32> unit size <integer_cst 0xb7d91168 4> align 32 symtab 0 alias set -1> arg 0 <component_ref 0xb7e1c7f8 type <record_type 0xb7e49564 ByteIterator> arg 0 <indirect_ref 0xb7e51320 type <record_type 0xb7e49ebc ConfLexerCore> arg 0 <ssa_name 0xb7da0540 type <pointer_type 0xb7e4e05c> var <parm_decl 0xb7d9fd70 this> def_stmt <nop_expr 0xb7e51340> version 1>> arg 1 <field_decl 0xb7e4e0b8 m_matchStart>>>>
4.1.2 also fails.
I have a fix.
Subject: Bug number PR28238 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00226.html
Subject: Bug 28238 Author: rguenth Date: Mon Jul 17 08:04:25 2006 New Revision: 115517 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115517 Log: 2006-07-17 Richard Guenther <rguenther@suse.de> PR tree-optimization/28238 * tree-inline.c (copy_bb): Check if we produced valid gimple copying and substituting a stmt. If not, gimplify it. * g++.dg/tree-ssa/pr28238.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/tree-ssa/pr28238.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-inline.c
Fixed on the mainline.
Subject: Bug 28238 Author: rguenth Date: Mon Jul 24 10:27:53 2006 New Revision: 115711 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115711 Log: 2006-07-24 Richard Guenther <rguenther@suse.de> PR tree-optimization/28238 * tree-inline.c (copy_bb): Check if we produced valid gimple copying and substituting a stmt. If not, gimplify it. * g++.dg/tree-ssa/pr28238.C: New testcase. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr28238.C Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/tree-inline.c
Fixed.