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

            Bug ID: 81342
           Summary: LTO: lto1: internal compiler error: Segmentation fault
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anatol.pomozov at gmail dot com
  Target Milestone: ---

I am using the latest version of gcc (7.1.0 built using
https://github.com/travisg/toolchains on Ubuntu 14.04) and I have following
crash if I try to use LTO with my project. The crash happens when I run liner
stage:

/home/anatol/sources/toolchains/x86_64-elf-7.1.0-Linux-x86_64/bin/x86_64-elf-gcc
arch/x86/apic.o arch/x86/interrupt.o arch/x86/interrupt_handler.o
arch/x86/mmu.o arch/x86/multiboot1.o arch/x86/pit.o arch/x86/start.o
arch/x86/start_64.o arch/x86/vga_console.o core/mem.o core/printf.o
core/string.o core/app.o -o out/app.elf -g -ggdb -flto -nostdlib -ffreestanding
-std=c11 -fno-stack-protector -mno-red-zone -fno-common -W -Wall -Wextra -O3
-I./include -Wl,-n -Wl,--gc-sections -Wl,-Tarch/x86/linker.ld


Here is the message from gcc:



lto1: internal compiler error: Segmentation fault
0x994e8f crash_signal
        ../../gcc-7.1.0/gcc/toplev.c:337
0xb4205d streamer_get_pickled_tree(lto_input_block*, data_in*)
        ../../gcc-7.1.0/gcc/tree-streamer-in.c:1111
0x8785b4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1452
0x87880a lto_input_tree(lto_input_block*, data_in*)
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1492
0xb41e97 lto_input_ts_decl_minimal_tree_pointers
        ../../gcc-7.1.0/gcc/tree-streamer-in.c:695
0xb41e97 streamer_read_tree_body(lto_input_block*, data_in*, tree_node*)
        ../../gcc-7.1.0/gcc/tree-streamer-in.c:1051
0x877edf lto_read_tree_1
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1333
0x878498 lto_read_tree
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1363
0x878498 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1475
0x878779 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned
int*)
        ../../gcc-7.1.0/gcc/lto-streamer-in.c:1387
0x5eaa3e lto_read_decls
        ../../gcc-7.1.0/gcc/lto/lto.c:1696
0x5ec41e lto_file_finalize
        ../../gcc-7.1.0/gcc/lto/lto.c:2040
0x5ec41e lto_create_files_from_ids
        ../../gcc-7.1.0/gcc/lto/lto.c:2050
0x5ec41e lto_file_read
        ../../gcc-7.1.0/gcc/lto/lto.c:2091
0x5ec41e read_cgraph_and_symbols
        ../../gcc-7.1.0/gcc/lto/lto.c:2803
0x5ec41e lto_main()
        ../../gcc-7.1.0/gcc/lto/lto.c:3308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error:
/usr/local/google/home/anatol/sources/toolchains/x86_64-elf-7.1.0-Linux-x86_64/bin/x86_64-elf-gcc
returned 1 exit status
compilation terminated.
/mnt/cold/sources/toolchains/x86_64-elf-7.1.0-Linux-x86_64/bin/../lib/gcc/x86_64-elf/7.1.0/../../../../x86_64-elf/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Reply via email to