Command line: $ gcc -O -fno-toplevel-reorder -fno-inline -fipa-cp -fipa-cp-clone -fkeep-inline-functions testcase.C Compiler output: $ gcc -O -fno-toplevel-reorder -fno-inline -fipa-cp -fipa-cp-clone -fkeep-inline-functions testcase.C testcase.C: In constructor 'Matrix::Matrix(AnyMatrixBase<OtherDerived>) [with OtherDerived = Matrix]': testcase.C:19:31: internal compiler error: in execute_todo, at passes.c:1276 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r163921 - crash r163636 - crash r161659 - OK
Created attachment 21717 [details] reduced testcase (from g++.dg/torture/pr42450.C) $ gcc -O -fno-toplevel-reorder -fno-inline -fipa-cp -fipa-cp-clone -fkeep-inline-functions pr45565.C
I have a patch.
Created attachment 21863 [details] Proposed fix
Fixed.
Subject: Bug 45565 Author: rguenth Date: Thu Sep 23 12:39:26 2010 New Revision: 164561 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164561 Log: 2010-09-23 Richard Guenther <rguenther@suse.de> PR tree-optimization/45565 * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Make sure to adjust the fndecl before replacing the stmt. * g++.dg/ipa/pr45565.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/ipa/pr45565.C Modified: trunk/gcc/ChangeLog trunk/gcc/cgraphunit.c trunk/gcc/testsuite/ChangeLog