[Bug lto/81847] New: ICE with LTO enabled

v at vsamko dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 15 21:18:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81847

            Bug ID: 81847
           Summary: ICE with LTO enabled
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: v at vsamko dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

I'm getting ICE with LTO in add_symbol_to_partition_1 when performing LTO on a
static library. ICE call stack is below.

Unfortunately I can not provide a test case as this only happens when I compile
a rather large proprietary application. When I try to reduce it to a simple
test case, the error becomes non deterministic (e.g. adding an empty .cpp file
sometimes triggers or stops triggering ICE).

If I disable lto partitioning (-flto-partition=none) I don't get ICE any more.
Are there any downsides of disabling LTO partitioning?

I can reproduce this problem with 7.1.0 and 7.2.0, and also with
https://github.com/gcc-mirror/gcc/commit/8388d80a5e86797b3c0822baf6d41c02fa8b41dd
patch applied to 7.2.0 .

If I instrument lto-partition.c:203 to print "node1" just before the assertion
(when it doesn't get added), I get "*.LTHUNK8" and "*.LTHUNK9" printed out a
number of times.

The command line that triggers this ICE is:
g++ -O3 -DNDEBUG -Wl,r file1.o file2.o -o merged.o -nostdlib

Is there any other instrumentation of investigation I can do on my side to help
identify the root of this ICE?

Valentine

--

lto1: internal compiler error: in add_symbol_to_partition_1, at
lto/lto-partition.c:203
0x13101d7 add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:203
0x130fa73 add_references_to_partition
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:93
0x130fbff add_references_to_partition
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:106
0x130fede add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:176
0x130ffeb add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:163
0x130fa73 add_references_to_partition
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:93
0x130fede add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:176
0x130fa73 add_references_to_partition
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:93
0x130fede add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:176
0x130ffda add_symbol_to_partition_1
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:161
0x13111a9 lto_balanced_map(int, int)
        ../../gcc-7.2.0/gcc/lto/lto-partition.c:550
0x1309947 do_whole_program_analysis
        ../../gcc-7.2.0/gcc/lto/lto.c:3125
0x1309947 lto_main()
        ../../gcc-7.2.0/gcc/lto/lto.c:3320


More information about the Gcc-bugs mailing list