Bug 45194 - lto1: internal compiler error: in lto_varpool_replace_node, at lto-symtab.c:292
Summary: lto1: internal compiler error: in lto_varpool_replace_node, at lto-symtab.c:292
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: lto
Depends on:
Blocks: mozillametabug
  Show dependency treegraph
 
Reported: 2010-08-05 11:45 UTC by Martin Jambor
Modified: 2010-09-17 00:27 UTC (History)
3 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: 2010-09-01 13:15:16


Attachments
Original testcase (272.27 KB, application/octet-stream)
2010-08-05 11:53 UTC, Martin Jambor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2010-08-05 11:45:56 UTC
With gcc trunk revision 162816 I am unable to compile Firefox with
WHOPR (or LTO, for that matter) because I get the following ICE:

lto1: internal compiler error: in lto_varpool_replace_node, at lto-symtab.c:292

I will attach preprocessed versions of four source files which are
necessary to reproduce the issue.
Comment 1 Martin Jambor 2010-08-05 11:53:27 UTC
Created attachment 21401 [details]
Original testcase

After extracting, set CC and CXX variables to paths to c and c++
compilers respectively and run the run script:

$ CXX=/abuild/mjambor/inst/icln/bin/g++ CC=/abuild/mjambor/inst/icln/bin/gcc ./run

+ /abuild/mjambor/inst/icln/bin/gcc -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c sysunix.i
+ /abuild/mjambor/inst/icln/bin/gcc -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c editline.i
+ /abuild/mjambor/inst/icln/bin/g++ -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c -fno-rtti -fpermissive -Wno-invalid-offsetof js.ii
+ /abuild/mjambor/inst/icln/bin/g++ -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c -fno-rtti -fpermissive -Wno-invalid-offsetof jsworkers.ii
+ /abuild/mjambor/inst/icln/bin/g++ -o js -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer js.o jsworkers.o editline.o sysunix.o -lpthread -Wl,-rpath-link,/bin -Wl,-rpath-link,/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm
lto1: internal compiler error: in lto_varpool_replace_node, at lto-symtab.c:292
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /abuild/mjambor/inst/icln/bin/g++ returned 1 exit status
/usr/bin/gold: fatal error: lto-wrapper failed
collect2: ld returned 1 exit status
Comment 2 Jan Hubicka 2010-08-22 09:15:47 UTC
It works for me on clean tree at today mainline.
+ ../xgcc -B .. -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c sysunix.i
+ ../xgcc -B .. -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c editline.i
+ ../g++ -B .. -L ../../x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/ -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c -fno-rtti -fpermissive -Wno-invalid-offsetof js.ii
+ ../g++ -B .. -L ../../x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/ -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer -c -fno-rtti -fpermissive -Wno-invalid-offsetof jsworkers.ii
+ ../g++ -B .. -L ../../x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/ -o js -fPIC -fno-exceptions -fwhopr=24 -fuse-linker-plugin -fno-strict-aliasing -pthread -pipe -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer js.o jsworkers.o editline.o sysunix.o -lpthread -Wl,-rpath-link,/bin -Wl,-rpath-link,/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -ldl -lm
/abuild/jh/trunk-install/x86_64-unknown-linux-gnu/bin/ld: /tmp/ccqrfzic.ltrans0.ltrans.o: in function _ZL18split_getObjectOpsP9JSContextP7JSClass.5202.4730:ccqrfzic.ltrans0.o(.text+0x2f): error: undefined reference to 'js_ObjectOps'
/abuild/jh/trunk-install/x86_64-unknown-linux-gnu/bin/ld: /tmp/ccqrfzic.ltrans0.ltrans.o: in function _ZL22ShellOperationCallbackP9JSContext.4851.5014:ccqrfzic.ltrans0.o(.text+0xb1): error: undefined reference to 'JS_ClearPendingException'
/abuild/jh/trunk-install/x86_64-unknown-linux-gnu/bin/ld: /tmp/ccqrfzic.ltrans0.ltrans.o: in function _ZN8ToStringC2EP9JSContextli.local.285.constprop.348.3463:ccqrfzic.ltrans0.o(.text+0xd4): error: undefined reference to 'JS_ValueToString'
....

Can you double check if it works for you too? Might be also gold bug.
Mine is:
jh@evans:/abuild/jh/trunk-2/gcc> gold --version
GNU gold (GNU Binutils; SUSE Linux Enterprise 11 2.20.0.20100122-0.7.9) 1.9
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Comment 3 Martin Jambor 2010-09-01 13:15:16 UTC
No, I still get the same ICE (on both the reduced testcase and firefox
as such) even with a recent checkout of trunk (revision 163677 from
yesterday).

Not only I use the same version of gold but apparently also the same
binary on the same computer :-)

How do you configure the gcc?  I use

/abuild/mjambor/icln/configure --prefix=/abuild/mjambor/inst/icln/ --enable-checking=yes --enable-languages=c,c++ --disable-bootstrap --enable-gold --with-plugin-ld=/usr/bin/gold

Comment 4 Jan Hubicka 2010-09-17 00:27:21 UTC
Hmm, so actually it is really difference in gold.
System gold on evans is
GNU gold (GNU Binutils; SUSE Linux Enterprise 11 2.20.0.20100122-0.7.9) 1.
while one I use is
GNU gold (GNU Binutils 2.20.51.20100706) 1.9

you might just grab gold binary from /abuild/jh/trunk-install/x86_64-unknown-linux-gnu/bin/

Sorry, I remembered I installed gold, but I tought it is long gone ;)
Honza