LTO causes internal compiler error (segmentation fault)

Bug #1647331 reported by Thargon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

Hi,
I encountered a bug that causes a segmentation fault of the the compiler during linker stage.

I tried to setup a minimal example that triggers the error, but I still need multiple files so the linker does something. Hence, I have attached all files as zip archive (5 source files with about 40 loc in total, a 6-line Makefile, and a table with some test results).

Compiling the code using the command in the Makefile results in the following error message:

In function '_GLOBAL__I_65535_0_B.o':
lto1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
compilation terminated.
/home/juser/Software/gcc-none-eabi/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

As you can see in the table, the issue occurs since the first GCC 4.9 release. Furthermore, the issue is gone when any of the compiler options (-flto, -O2, -fstack-usage) is removed.

I am aware that the given code example does not make any sense, but it is just the minimum configuration I could extract from my project. In any case, the compiler should throw warnings or errors, but no segmentation fault.

Please let me know if you can reproduce the error or if you need further information.

Tags: ice lto segfault
Revision history for this message
Thargon (thomas-schoepping) wrote :
tags: added: ice
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.