I get the following ICE with gcc 4.2. This looks suspiciously a lot like PR26994 but the patch suggested there is Fortran specific whereas my test case is C++. Maybe there is a more fundamental problem somewhere? (sid)3300:tbm@test: ~/delta/bin] /usr/lib/gcc-snapshot/bin/g++ -c -O mini.c mini.c: In member function 'camp::drawElement* camp::drawPath::transformed(const camp::transform&)': mini.c:87: error: invalid operand to unary operator &*D.2372_31; mini.c:87: 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 mini.c (sid)3301:tbm@test: ~/delta/bin] /usr/lib/gcc-snapshot/bin/g++ -c mini.c (sid)3302:tbm@test: ~/delta/bin]
Created attachment 11543 [details] test case
This really unrelated to that fortran bug. Anyways I might take a look soon.
Confirmed, reduced testcase: struct gc{}; struct transform:public gc { double x, y, z, t; transform (void){} }; inline transform f (void) { return transform (); }; void transformed (void) { new transform (f()); } ------------------------------------------------ This is return slot related and inline related, we have: *D.2030 = f () [return slot optimization]; ........ __comp_ctor (&<retval>); return <retval>;
Also fails with 4.1.2. Janis, can you look what introduced this?
A regression hunt on powerpc-linux with the testcase in comment #3 identified this mainline patch: http://gcc.gnu.org/viewcvs?view=rev&rev=112709 r112709 | rguenth | 2006-04-05 15:41:18 +0000 (Wed, 05 Apr 2006) The same patch was added to the 4.1 branch a couple of days later, so I assume it's also the cause of the failure there. GCC 4.1.0 does not fail.
I guess the patch uncovered a latent problem due to different inlining. I will have a look though.
I have a fix.
Subject: Bug number PR27830 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-06/msg00385.html
Subject: Bug 27830 Author: rguenth Date: Tue Jun 13 07:22:04 2006 New Revision: 114600 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114600 Log: 2006-06-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/27830 * tree-inline.c (copy_body_r): For copying the operand of an ADDR_EXPR make sure to fold &* afterwards. * g++.dg/tree-ssa/pr27830.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/tree-ssa/pr27830.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-inline.c
Subject: Bug 27830 Author: rguenth Date: Fri Jun 16 12:03:24 2006 New Revision: 114716 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114716 Log: 2006-06-16 Richard Guenther <rguenther@suse.de> PR tree-optimization/27830 * tree-inline.c (copy_body_r): For copying the operand of an ADDR_EXPR make sure to fold &* afterwards. * g++.dg/tree-ssa/pr27830.C: New testcase. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr27830.C - copied unchanged from r114600, trunk/gcc/testsuite/g++.dg/tree-ssa/pr27830.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.