Bug 735846 - lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:994
Summary: lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:994
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-05 17:06 UTC by Paul Reich
Modified: 2011-09-06 14:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-06 14:30:02 UTC


Attachments (Terms of Use)
Command output for 2 cases, and GCC configuration [LONG] (16.34 KB, text/plain)
2011-09-05 19:06 UTC, Paul Reich
no flags Details

Description Paul Reich 2011-09-05 17:06:12 UTC
Background:
I am trying out the new lto feature of gcc, with infrastructure from fedora 15.
I want to bootstrap the compiler to bootstrap using LTO and profiling. I
also wish to exclude 32 bit support.  An attachment contains the configuration 
and output files.

The computer is an e-machines T-6520 containing an AMD "k8" processor,
with 1024 MB RAM.  Running Fedora 14, with infrastructure backported 
from Fedora 15. Kernel is linux-3.0.3. gcc stage 1 was compiled with
gcc-4.6.0, and binutils-2.21.53.0.1-2.

Description of problem:
Cannot bootstrap gcc-4.6.1-8.src.rpm with selected ./configure options.
Stage 2 of gcc-4.6.1-8 (from $objdir/intl config.log) fails at beginning of
stage 2 for target "profiledbootstrap".

At the start of  stage 2, ../configure fails with the following error:

.....................

lto1: error: bad value (k8) for -mstringop-strategy= switch
lto-wrapper: /home/makerpm/......./prev-gcc/xgcc returned 1 exit status
/usr/bin/ld: fatal error: lto-wrapper failed
collect2: ld returned 1 exit status
configure:3004: $? = 1
configure:3041: result: 
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3047: error: in `/home/makerpm/rpmbuild/BUILD/gcc-4.6.1-20110824
configure:3051: error: C compiler cannot create executables
See `config.log' for more details.

...............................

Version-Release number of selected component: gcc-4.6.1-8 Fedora rawhide.

How reproducible:  Always. Create a file "conftest.c" to be same as the 
script in ../configure.  See attachment.

Steps to Reproduce:

1. Create a file "conftest.c" in /obj-x86_64-redhat-linux, see attachment.
2. From $objdir, manually type in the command line (same as config.log)
3. Observe result.
  
Actual results: Something stuffs the value "k8" into the "-mstringop-strategy="
switch. The "-mstringop-strategy=" switch expects the name of an algorithm.
k8 is the target processor for which we were compiling.

Expected results:  A valid algorithm name should have been selected by the bootstrap/build process of stage 1, and inserted into the "-mstringop-
strategy=" switch  when running the configure script at the start of stage 2.
Configure script and stage 2 bootstrap should continue to completion. 

Additional info:

Alternate procedure causes ICE in lto1 when a valid ALG name is stuffed into 
the -mstringop-strategy= switch.

1.  Create conftest.c as before.
2.  Manually type in the following command from $objdir (including 
    -mstringop-strategy=rep_8byte), as follows:

/home/makerpm/rpmbuild/BUILD/gcc-4.6.1-20110824/obj-x86_64-redhat-linux/./prev-gcc/xgcc -B/home/makerpm/rpmbuild/BUILD/gcc-4.6.1-20110824/obj-x86_64-redhat-linux/./prev-gcc/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/bin/ -B/usr/x86_64-redhat-linux/lib/ -isystem /usr/x86_64-redhat-linux/include -isystem /usr/x86_64-redhat-linux/sys-include  -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-generate -fno-lto -mstringop-strategy=rep_8byte -save-temps  -static-libstdc++ -static-libgcc  ../conftest.c

3.Observe:

lto1: internal compiler error: in lto_tag_to_tree_code, at lto-streamer.h:994
Please submit a full bug report,
with preprocessed source if appropriate.
....
lto-wrapper: /home/makerpm/rpmbuild/BUILD/gcc-4.6.1-20110824/obj-x86_64-redhat-linux/./prev-gcc/xgcc returned 1 exit status
[Leaving LTRANS /tmp/ccBfjWWU.ltrans.out]
[Leaving LTRANS /tmp/ccFtVf2x.args]
/usr/bin/ld: fatal error: lto-wrapper failed
collect2: ld returned 1 exit status

FAILED PROGRAM WAS confdefs.c

Preprocessed source and output files are in the attachment.

Please let me know if you need any additional info. (Much) more information is 
in the attachment.


Regards,


Paul Reich
reichp@att.net

Comment 1 Paul Reich 2011-09-05 19:06:09 UTC
Created attachment 521541 [details]
Command output for 2 cases, and GCC configuration [LONG]

Comment 2 Jakub Jelinek 2011-09-06 14:30:02 UTC
Can't reproduce,
/usr/src/gcc-4.6-rh/obj/gcc/xgcc -B /usr/src/gcc-4.6-rh/obj/gcc/ -g -O2 -flto=jobserver -frandom-seed=1 -fprofile-generate -fno-lto -mstringop-strategy=rep_8byte -o conftest{,.c} -save-temps  -static-libstdc++ -static-libgcc
works just fine for me, so does the same without -fno-lto.


Note You need to log in before you can comment on or make changes to this bug.