Command line: $ g++ -O2 -fprofile-generate testcase.C Compiler output: $ g++ -O2 -fprofile-generate testcase.C testcase.C: In function 'B bar(B)': testcase.C:16:1: internal compiler error: in tree_nrv, at tree-nrv.c:155 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Tested revisions: r161428 - crash r161383 - crash r161170 - OK
Created attachment 21015 [details] reduced testcase (from g++.dg/lto/20090221_0.C) Command line: $ g++ -O2 -fprofile-generate pr44687.C
Works with: GNU C++ (GCC) version 4.6.0 20100621 (experimental) [trunk revision 161061] (x86_64-unknown-linux-gnu) So it must be in the last week.
It is caused by revision 161382: http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg01300.html
This same ICE also happens w/o -fprofile-generate: regehr@john-home:~/volatile/bugs/tmp318$ current-gcc -v Using built-in specs. COLLECT_GCC=current-gcc COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r161425-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --with-libelf=/usr/local --enable-lto --prefix=/home/regehr/z/compiler-install/gcc-r161425-install --program-prefix=r161425- --enable-languages=c,c++ Thread model: posix gcc version 4.6.0 20100626 (experimental) (GCC) regehr@john-home:~/volatile/bugs/tmp318$ current-gcc -O2 small.c small.c: In function ‘func_72’: small.c:24:1: internal compiler error: in tree_nrv, at tree-nrv.c:155 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. regehr@john-home:~/volatile/bugs/tmp318$ cat small.c typedef int int32_t; typedef unsigned char uint8_t; struct S0 { uint8_t f0; }; struct S0 *g_18[7][5][1][1] = { }; struct S0 **g_17 = &g_18[0][3][0][0]; int32_t g_86; struct S0 func_72 (uint8_t p_73, struct S0 p_74); void int326 (struct S0 **p_67, int32_t p_68, int32_t * *const p_69, struct S0 *p_70) { struct S0 l_95 = { -1L }; func_72 (1L, func_72 (0, l_95)); } struct S0 func_72 (uint8_t p_73, struct S0 p_74) { int32_t *l_85 = &g_86; if (*l_85) lbl_94:*l_85 ^= 0; if (g_86) goto lbl_94; return **g_17; }
Subject: Bug 44687 Author: hubicka Date: Mon Jun 28 15:51:25 2010 New Revision: 161500 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161500 Log: PR tree-optimization/44687 * gcc.c-torture/compile/pr44687.c PR tree-optimization/44687 * ipa-split.c (split_function): Use DECL_RESULT to store return value. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr44687.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-split.c trunk/gcc/testsuite/ChangeLog
Fixed.