Bug 81612 - lto1: internal compiler error: Segmentation fault
Summary: lto1: internal compiler error: Segmentation fault
Status: WAITING
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-29 19:06 UTC by vctrex
Modified: 2017-08-01 11:49 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-07-31 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vctrex 2017-07-29 19:06:51 UTC
With avr-gcc-6.3.0_1 compiling anything with Serial.begin() results an error.

Arduino:1.8.3 (Linux)

lto1: internal compiler error: Segmentation fault
0x8b64df crash_signal
	../../gcc/toplev.c:333
0x7f4f10c34a8f ???
	/builddir/glibc-2.25/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7428b6 maybe_record_node
	../../gcc/ipa-devirt.c:2468
0x747245 possible_polymorphic_call_targets(tree_node*, long, ipa_polymorphic_call_context, bool*, void**, bool)
	../../gcc/ipa-devirt.c:3186
0x747d0e possible_polymorphic_call_targets(cgraph_edge*, bool*, void**, bool)
	../../gcc/ipa-utils.h:115
0x747d0e ipa_devirt
	../../gcc/ipa-devirt.c:3597
0x747d0e execute
	../../gcc/ipa-devirt.c:3913
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: /usr/bin/avr-gcc returned 1 exit status
compilation terminated.
/usr/bin/avr-ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
exit status 1
Comment 1 Martin Liška 2017-07-31 05:51:47 UTC
Can you please attach a pre-processed source code that triggers that?
Comment 2 vctrex 2017-08-01 08:31:25 UTC
The arduino code is:

void setup() {
  Serial.begin(9600);
}

void loop() {
}

Arduino:1.8.3 (Linux), Płytka:"Arduino/Genuino Uno"

/usr/lib/arduino/arduino-builder -dump-prefs -logger=machine -hardware /usr/lib/arduino/hardware -tools /usr/lib/arduino/tools-builder -built-in-libraries /usr/lib/arduino/libraries -libraries /home/vctrex/Kod/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_621292 -warnings=all -build-cache /tmp/arduino_cache_74036 -prefs=build.warn_data_percentage=75 -verbose /tmp/arduino_modified_sketch_352971/ReadASCIIString.ino
/usr/lib/arduino/arduino-builder -compile -logger=machine -hardware /usr/lib/arduino/hardware -tools /usr/lib/arduino/tools-builder -built-in-libraries /usr/lib/arduino/libraries -libraries /home/vctrex/Kod/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /tmp/arduino_build_621292 -warnings=all -build-cache /tmp/arduino_cache_74036 -prefs=build.warn_data_percentage=75 -verbose /tmp/arduino_modified_sketch_352971/ReadASCIIString.ino
Using board 'uno' from platform in folder: /usr/lib/arduino/hardware/arduino/avr
Using core 'arduino' from platform in folder: /usr/lib/arduino/hardware/arduino/avr
Detecting libraries used...
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/usr/lib/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/lib/arduino/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_621292/sketch/ReadASCIIString.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/usr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/usr/lib/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/lib/arduino/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_621292/sketch/ReadASCIIString.ino.cpp" -o "/tmp/arduino_build_621292/preproc/ctags_target_for_gcc_minus_e.cpp"
"/usr/lib/arduino/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_621292/preproc/ctags_target_for_gcc_minus_e.cpp"
Kompilowanie szkicu...
"/usr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/usr/lib/arduino/hardware/arduino/avr/cores/arduino" "-I/usr/lib/arduino/hardware/arduino/avr/variants/standard" "/tmp/arduino_build_621292/sketch/ReadASCIIString.ino.cpp" -o "/tmp/arduino_build_621292/sketch/ReadASCIIString.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/usr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "/tmp/arduino_build_621292/ReadASCIIString.ino.elf" "/tmp/arduino_build_621292/sketch/ReadASCIIString.ino.cpp.o" "/tmp/arduino_build_621292/../arduino_cache_74036/core/core_arduino_avr_uno_1463c1525e5674af859013f08ea32c59.a" "-L/tmp/arduino_build_621292" -lm
lto1: internal compiler error: Segmentation fault
0x8b64df crash_signal
	../../gcc/toplev.c:333
0x7fb8faf8ea8f ???
	/builddir/glibc-2.25/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7428b6 maybe_record_node
	../../gcc/ipa-devirt.c:2468
0x747245 possible_polymorphic_call_targets(tree_node*, long, ipa_polymorphic_call_context, bool*, void**, bool)
	../../gcc/ipa-devirt.c:3186
0x747d0e possible_polymorphic_call_targets(cgraph_edge*, bool*, void**, bool)
	../../gcc/ipa-utils.h:115
0x747d0e ipa_devirt
	../../gcc/ipa-devirt.c:3597
0x747d0e execute
	../../gcc/ipa-devirt.c:3913
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: /usr/bin/avr-gcc returned 1 exit status
compilation terminated.
/usr/bin/avr-ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
exit status 1
Błąd kompilacji dla płytki Arduino/Genuino Uno.

And here is Seria.begin() definiton which will probably come handy.
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/HardwareSerial.h
Comment 3 Martin Liška 2017-08-01 08:34:21 UTC
Thanks, but I will need output generated with '-E' which will create pre-processed source file that I can test.
Can you please create it for me?
Comment 4 vctrex 2017-08-01 09:45:50 UTC
I did tried to create pre-procesed code, but I am unable to make Arduino do so. I'm sorry, I had tried but I just can't.
Comment 5 Martin Liška 2017-08-01 10:41:19 UTC
Ok, are you able to at least append build flags (CFLAGS) to the build system? If so, adding --save-temps and --verbose will save the file and you can attach it here.
Comment 6 Martin Liška 2017-08-01 11:49:36 UTC
I bet it's dup of PR79760 which is fixed in GCC 6.4. Can you please that?