[Bug lto/86344] New: GCC 8.1 ICEd at LTO stage

2018-06-28 Thread oddin at mimecast dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86344

Bug ID: 86344
   Summary: GCC 8.1 ICEd at LTO stage
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: oddin at mimecast dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

I have a fairly large C++ project that I build with LTO (including dependencies
that are packaged up in LTO form) which successfully LTOs on GCC6 and Clang6.
However, I get this error when trying it with GCC8.1:

lto1: internal compiler error: in add_symbol_to_partition_1, at
lto/lto-partition.c:203
0x5658ca add_symbol_to_partition_1
../.././gcc/lto/lto-partition.c:203
0x5c977b add_references_to_partition
../.././gcc/lto/lto-partition.c:93
0x5c99fd add_symbol_to_partition_1
../.././gcc/lto/lto-partition.c:176
0x5c9b15 add_symbol_to_partition_1
../.././gcc/lto/lto-partition.c:161
0x5c9b15 add_symbol_to_partition_1
../.././gcc/lto/lto-partition.c:161
0x5cb942 lto_balanced_map(int, int)
../.././gcc/lto/lto-partition.c:551
0x5c2429 do_whole_program_analysis
../.././gcc/lto/lto.c:3218
0x5c2429 lto_main()
../.././gcc/lto/lto.c:3413

Unfortunately I've not yet been able to create a minimal sample and am sadly
not able to provide a dump of everything it's LTOing due to license
constraints.

output of gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/8.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --enable-plugin --enable-lto --enable-gold
--with-plugin-ld=gold --enable-shared --enable-threads=posix
--enable-checking=release --enable-multilib --enable-linker-build-id
--with-linker-hash-style=gnu --enable-libmpx
Thread model: posix
gcc version 8.1.0 (GCC)

Compiler arguments passed at build-time are -O3 -flto -fuse-ld=gold (same crash
is produced if I omit the gold linker)

[Bug lto/86344] GCC 8.1 ICEd at LTO stage

2018-07-04 Thread oddin at mimecast dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86344

--- Comment #4 from Oliver Ddin  ---
So, I grabbed GCC8.1.1 from trunk and built it. Crash reoccured.

However, I noticed that GCC wasn't doing LTO through the linker plugin, so
after rebuilding with the correct configuration to enable -fuse-linker-plugin
to work, I then rebuilt the project and this time, LTO succeeded without error.

So, I suspect this is specifically a bug that manifests when doing LTO without
using the linker plugin. I unfortunately don't have anything better for you at
this point and since I now have a working build, I'll probably not get the time
to find a minimal case that reproduces this in the non-linker-plugin scenario.