Bug 55493 - [4.8 Regression] LTO always ICEs on native i686-mingw32
Summary: [4.8 Regression] LTO always ICEs on native i686-mingw32
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.8.0
: P3 major
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 16:21 UTC by Fanael
Modified: 2013-03-08 14:41 UTC (History)
3 users (show)

See Also:
Host: i686-*-mingw32
Target: i686-*-mingw32
Build:
Known to work: 4.7.2
Known to fail: 4.8.0
Last reconfirmed: 2013-01-07 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fanael 2012-11-27 16:21:23 UTC
Revision 193777 ICEs with 

    lto1.exe: internal compiler error: cannot read LTO decls from <the object file>

when linking with -flto on i686-w64-mingw32. This happens for all inputs, even for "int main() { return 0; }" or "" (that is, an empty file).

 >> gcc -v
Using built-in specs.
COLLECT_GCC=C:\devel\mingw\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/devel/mingw/bin/../libexec/gcc/i686-w64-mingw32/4.8.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../gcc-4.8-svn/configure --disable-nls --build=i686-w64-mingw32 --disable-multilib --enable-languages=c,c++,lto --disable-win32-registry --enable-openmp --enable-libgomp --enable-graphite --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-threads=posix --disable-symvers --enable-fully-dynamic-string --disable-libstdcxx-pch --with-arch=i686 --with-tune=generic --enable-checking=release --disable-werror --disable-sjlj-exceptions --prefix=/c/builds/gcc/toolchain/out --with-gmp=/c/builds/gcc/prerequisites/out --with-mpfr=/c/builds/gcc/prerequisites/out --with-mpc=/c/builds/gcc/prerequisites/out --with-isl=/c/builds/gcc/prerequisites/out --with-cloog=/c/builds/gcc/prerequisites/out --with-libiconv-prefix=/c/builds/gcc/prerequisites/out --with-host-libstdcxx=-lstdc++ --enable-cloog-backend=isl
Thread model: posix
gcc version 4.8.0 20121124 (experimental) (GCC)
Comment 1 Fanael 2012-11-27 16:25:58 UTC
Forgot to mention:

4.7.2 - works
4.8.0 r193777 - fails
Comment 2 Richard Biener 2013-01-07 15:25:22 UTC
Are you sure that you do not somehow pull in LTO objects from older releases?
Needs someone with access to $target to debug.
Comment 3 Fanael 2013-01-09 14:19:09 UTC
(In reply to comment #2)
> Are you sure that you do not somehow pull in LTO objects from older releases?

Yes, happens even with -nostdlib, even on builds where I'm absolutely sure there's no way an old LTO object could sneak in.
Comment 4 Kai Tietz 2013-01-15 17:38:31 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Are you sure that you do not somehow pull in LTO objects from older releases?
> 
> Yes, happens even with -nostdlib, even on builds where I'm absolutely sure
> there's no way an old LTO object could sneak in.

I can't reproduce that.  btw how are you doing linker-tests without specifying object-code and libraries?
Nevertheless I assume that runtime is build with older-version of gcc.  It is a bit sad that LTO doesn't tell that version is outdated.

I've tested it with gcc version from 15th of January 2012 and it works flawless.  But I have rebuild my runtime with new version.  That is recommented to do.

I would suggest to close that bug as WORKSFORME
Comment 5 Kai Tietz 2013-01-15 18:32:45 UTC
After retesting it, I close it as works for me.
Comment 6 Fanael 2013-01-16 18:15:25 UTC
Oh right. Works for me too. I should've tested it more thoroughly first.

Sorry for bothering you guys.
Comment 7 Fanael 2013-01-18 18:45:50 UTC
Reopening.

The build that worked for me was a cross compiler on x86_64-unknown-linux-gnu host. Native compiler on i686-mingw32 host still fails when trying to use LTO. So either I'm doing something terribly wrong (I think I'm not, I built everything from scratch with the very same compiler version this time), or there *is* a bug.
Comment 8 Ruben Van Boxem 2013-01-20 18:34:11 UTC
I can confirm that this bug is present for GCC 4.8 dated 20121221, which is available here: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-unstable/i686-w64-mingw32-gcc-4.8-unstable-win32_rubenvb.7z/download

I get:

lto1.exe: internal compiler error: cannot read LTO decls from R:\temp\ccgzHybZ.o
Please submit a full bug report,
with preprocessed source if appropriate.
See <mingw-w64-public@lists.sourceforge.net> for instructions.
lto-wrapper: g++ returned 1 exit status
m:/development/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Comment 9 Richard Biener 2013-02-08 14:58:02 UTC
Somebody needs to debug this.
Comment 10 Kai Tietz 2013-02-12 15:27:45 UTC
Well, I re-tried to reproduce this issue with current 4.8 gcc version (native).
As before, I can't reproduce that issue.  Anyway I don't get what report was actual doing differently as I did, so I will keep this bug open.
Nevertheless we had recently some changes to lto, which are affecting mingw targets, so it might be worth that report are retrying to reproduce.

Please make sure that you aren't mixing objects with LTO-infomration of different versions.
Comment 11 Fanael 2013-02-27 16:39:56 UTC
Revision 196313 appears to work.