Bug 47162 - [4.6 Regression] LTO is broken
Summary: [4.6 Regression] LTO is broken
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.0
: P1 normal
Target Milestone: 4.6.0
Assignee: Martin Jambor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 02:06 UTC by H.J. Lu
Modified: 2011-01-05 15:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-01-04 09:57:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2011-01-04 02:06:17 UTC
On Linux/x86-64, revision168439 gave:

/export/gnu/import/svn/gcc-test/bld/./prev-gcc/xgcc -B/export/gnu/import/svn/gcc-test/bld/./prev-gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include      -g -O2 -flto=jobserver -fuse-linker-plugin -frandom-seed=1 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc  -o build/genconstants \
	    build/genconstants.o build/read-md.o build/errors.o .././libiberty/libiberty.a
lto1: internal compiler error: bytecode stream: trying to read 0 bytes after the end of the input buffer
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[7]: *** [/tmp/cc7rbITJ.ltrans0.ltrans.o] Error 1
lto-wrapper: make returned 2 exit status
/usr/local/x86_64-unknown-linux-gnu/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status
make[6]: *** [build/genconstants] Error 1
make[6]: *** Waiting for unfinished jobs....
lto1: internal compiler error: bytecode stream: expected tag tree_list instead of LTO_UNKNOWN
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[7]: *** [/tmp/cc2SG2hC.ltrans2.ltrans.o] Error 1
make[7]: *** Waiting for unfinished jobs....
lto-wrapper: make returned 2 exit status
/usr/local/x86_64-unknown-linux-gnu/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status
make[6]: *** [build/genenums] Error 1
rm gcj-dbtool.pod jcf-dump.pod jv-convert.pod grmic.pod gcj.pod gc-analyze.pod cpp.pod gfdl.pod gij.pod gcc.pod gcov.pod gfortran.pod fsf-funding.pod
make[6]: Leaving directory `/export/gnu/import/svn/gcc-test/bld/gcc'
make[5]: *** [all-stage2-gcc] Error 2
make[5]: Leaving directory `/export/gnu/import/svn/gcc-test/bld'
make[4]: *** [stage2-bubble] Error 2
make[4]: Leaving directory `/export/gnu/import/svn/gcc-test/bld'
make[3]: *** [bootstrap] Error 2
make[3]: Leaving directory `/export/gnu/import/svn/gcc-test/bld'

and benchspec/CINT2000/176.gcc/run/00000001/make.err:

 lto1: internal compiler error: bytecode stream: trying to read 0 bytes after the end of the input buffer
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [/tmp/ccWt9u22.ltrans4.ltrans.o] Error 1
lto-wrapper: make returned 2 exit status
/usr/local/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status

Revision 168415 is OK.
Comment 1 H.J. Lu 2011-01-04 05:51:48 UTC
It is caused by revision 168420:

http://gcc.gnu.org/ml/gcc-cvs/2011-01/msg00036.html
Comment 2 Martin Jambor 2011-01-04 09:57:00 UTC
I can reproduce the failure, let me try to fix it.
Comment 3 H.J. Lu 2011-01-04 13:38:05 UTC
The easiest way to reproduce is to configure gcc with

--enable-languages=c --with-build-config=bootstrap-lto
Comment 4 Martin Jambor 2011-01-04 13:49:12 UTC
Restoring the bug status and priority which I believe were inadvertently modified with the previous comment.
Comment 5 Martin Jambor 2011-01-04 18:49:33 UTC
Proposed fix posted to the mailing list:

http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00161.html
Comment 6 hjl@gcc.gnu.org 2011-01-05 14:55:32 UTC
Author: hjl
Date: Wed Jan  5 14:55:27 2011
New Revision: 168515

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168515
Log:
Fix PR lto/47162.

2011-01-05  Martin Jambor  <mjambor@suse.cz>

	PR lto/47162
	* lto-cgraph.c (output_cgraph_opt_summary_p): Also check for thunk
	deltas on streamed outgoing edges.
	(output_node_opt_summary): Output info for outgoing edges only when
	the node is in new parameter set.
	(output_cgraph_opt_summary): New parameter set, passed to the two
	aforementioned functions.  Update its forward declaration and its
	callee too.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-cgraph.c
Comment 7 Martin Jambor 2011-01-05 15:39:41 UTC
Fixed.