lto1.exe: internal compiler error: in splice_child_die, at dwarf2out.c:4905

Bug #1674525 reported by Andrey B
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Fix Released
Medium
Thomas Preud'homme

Bug Description

trying to migrate from 2014 Mentor/CodeSourcery G++ Lite to 5.4_2016q3 or 6_2017-q1 but both fail with same

lto1.exe: internal compiler error: in splice_child_die, at dwarf2out.c:4905
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper.exe: fatal error: arm-none-eabi-g++ returned 1 exit status
compilation terminated.
c:/progra~1/gnu_tools/5.4_2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed

I was able to isolate the issue to if -g is passed to linker or not: does not fail without -g, fails with -g or g3

compiling on windows 7 64 bit, issue is reproducible 100% of the time.

Revision history for this message
Andrey B (arro239) wrote :
Download full text (8.9 KiB)

cs-make all
Building target: rusefi.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -ffunction-sections -fdata-sections -g -T "..\config\stm32f4ems\STM32F407xG_CCM.ld" -Xlinker --gc-sections -Wl,-Map,"rusefi.map" -Wl,-Map,"rusefi.map" -o "rusefi.elf" ./util/LocalVersionHolder.o ./util/cli_registry.o ./util/crc.o ./util/cyclic_buffer.o ./util/data_buffer.o ./util/datalogging.o ./util/efilib.o ./util/efilib2.o ./util/histogram.o ./util/listener_array.o ./util/loggingcentral.o ./util/rfiutil.o ./hw_layer/stm32f4/mpu_util.o ./hw_layer/stm32f4/stm32f4xx_hal_flash.o ./hw_layer/stm32f4/stm32f4xx_hal_flash_ex.o ./hw_layer/serial_over_usb/usbcfg.o ./hw_layer/serial_over_usb/usbconsole.o ./hw_layer/sensors/CJ125.o ./hw_layer/mass_storage/usb_msd.o ./hw_layer/mass_storage/usb_msd_cfg.o ./hw_layer/lcd/lcd_HD44780.o ./hw_layer/HIP9011.o ./hw_layer/accelerometer.o ./hw_layer/adc_inputs.o ./hw_layer/board_test.o ./hw_layer/can_hw.o ./hw_layer/digital_input_hw.o ./hw_layer/flash.o ./hw_layer/gpio_helper.o ./hw_layer/hardware.o ./hw_layer/io_pins.o ./hw_layer/joystick.o ./hw_layer/max31855.o ./hw_layer/mcp3208.o ./hw_layer/microsecond_timer.o ./hw_layer/mmc_card.o ./hw_layer/neo6m.o ./hw_layer/pin_repository.o ./hw_layer/pwm_generator.o ./hw_layer/rtc_helper.o ./hw_layer/servo.o ./hw_layer/stepper.o ./hw_layer/trigger_input.o ./hw_layer/vehicle_speed.o ./development/test/test.o ./development/test/testbmk.o ./development/hw_layer/poten.o ./development/engine_emulator.o ./development/engine_sniffer.o ./development/rfi_perftest.o ./development/sensor_chart.o ./development/trigger_emulator.o ./development/wave_analyzer.o ./controllers/trigger/decoders/trigger_bmw.o ./controllers/trigger/decoders/trigger_chrysler.o ./controllers/trigger/decoders/trigger_gm.o ./controllers/trigger/decoders/trigger_honda.o ./controllers/trigger/decoders/trigger_mazda.o ./controllers/trigger/decoders/trigger_mitsubishi.o ./controllers/trigger/decoders/trigger_nissan.o ./controllers/trigger/decoders/trigger_rover.o ./controllers/trigger/decoders/trigger_subaru.o ./controllers/trigger/decoders/trigger_toyota.o ./controllers/trigger/decoders/trigger_universal.o ./controllers/trigger/main_trigger_callback.o ./controllers/trigger/rpm_calculator.o ./controllers/trigger/spark_logic.o ./controllers/trigger/trigger_central.o ./controllers/trigger/trigger_decoder.o ./controllers/trigger/trigger_emulator_algo.o ./controllers/trigger/trigger_simulator.o ./controllers/trigger/trigger_structure.o ./controllers/system/SingleTimerExecutor.o ./controllers/system/efiGpio.o ./controllers/system/event_queue.o ./controllers/system/pwm_generator_logic.o ./controllers/system/signal_executor_sleep.o ./controllers/sensors/allsensors.o ./controllers/sensors/ego.o ./controllers/sensors/hip9011_lookup.o ./controllers/sensors/maf.o ./controllers/sensors/map.o ./controllers/sensors/thermistors.o ./controllers/sensors/tps.o ./controllers/sensors/voltage.o ./controllers/math/biquad.o ./controllers/math/engine_math.o ./controllers/math/pid.o ./controllers/math/speed_density.o ./controllers/core/EfiWave.o ./cont...

Read more...

Revision history for this message
Andrey B (arro239) wrote :

Apprantly chibios people are aware of this as "there is a bug with gcc-arm-none-eabi-4_8-2014q1 which prevent to use -flto and -gddb together."

As soon as I've removed -flto things seems to work.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi there,

Could you post instructions to reproduce this issue? Which version of Chibios shows this problem and how to build it?

Best regards.

Changed in gcc-arm-embedded:
status: New → Incomplete
Revision history for this message
Andrey B (arro239) wrote :

I know it's not the best way to reproduce an issue but can you download my whole project? It embedds Chibios 2.6, I believe ChibiOS prior to 3.0 is affected. While yes this is an order version of ChibiOS I would assume gcc should not fail with internal error regardless?

Download & unzip http://rusefi.com/data/issue_1674525.zip
make

expected result: successful compilation & linking or human-readable error message

actual result:
lto1.exe: internal compiler error: in splice_child_die, at dwarf2out.c:4905
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper.exe: fatal error: C:\Progra~1\GNU_Tools\5.4_2016q3\bin\arm-none-eabi-gcc.exe returned 1 exit status
compilation terminated.
c:/progra~1/gnu_tools/5.4_2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
make: *** [chibios/os/ports/GCC/ARMCMx/rules.mk:211: build/rusefi.elf] Error 1

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi Andrey,

Perfect, I can reproduce it. Yes you're right, however old is ChibiOS in there does not matter, the compiler should just not crash.

Best regards.

Changed in gcc-arm-embedded:
status: Incomplete → Confirmed
assignee: nobody → Thomas Preud'homme (thomas-preudhomme)
importance: Undecided → Medium
Changed in gcc-arm-embedded:
milestone: none → 8-2018-q4-major
milestone: 8-2018-q4-major → none
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

This appears to be fixed in our 7-2017Q4 release. Can you confirm Andrey?

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Note you'll need 2 more -Wno-* for the compilation to work with GCC 7.

Revision history for this message
Andrey B (arro239) wrote :

This now compiles just fine, I guess we can close this one!

Joey Ye (jinyun-ye)
Changed in gcc-arm-embedded:
status: Confirmed → Fix Released
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.