Following is iceing: $ cat /tmp/ice.i float a; __attribute__((__target__("fpmath=387"))) void b() { if (a) __builtin_abort(); } void c() { b(); } $ ./xgcc -B. -O2 -fopt-info /tmp/ice.i -c during GIMPLE pass: einline /tmp/ice.i: In function ‘c’: /tmp/ice.i:9:1: internal compiler error: Segmentation fault 9 | void c() { b(); } | ^~~~ 0xd0f73f crash_signal /home/marxin/Programming/gcc/gcc/toplev.c:325 0x7ffff6bc310f ??? /usr/src/debug/glibc-2.27-6.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x7ffff6c03d8a fputc /usr/src/debug/glibc-2.27-6.1.x86_64/libio/fputc.c:35 0xc29812 cl_target_option_print_diff(_IO_FILE*, int, cl_target_option*, cl_target_option*) /dev/shm/objdir/gcc/options-save.c:3803 0x155bf98 report_inline_failed_reason /home/marxin/Programming/gcc/gcc/ipa-inline.c:248 0x155c470 can_inline_edge_p /home/marxin/Programming/gcc/gcc/ipa-inline.c:381 0x155d386 can_early_inline_edge_p /home/marxin/Programming/gcc/gcc/ipa-inline.c:578 0x1563c1b early_inline_small_functions /home/marxin/Programming/gcc/gcc/ipa-inline.c:2690 0x1564018 early_inliner(function*) /home/marxin/Programming/gcc/gcc/ipa-inline.c:2803 0x1564225 execute /home/marxin/Programming/gcc/gcc/ipa-inline.c:2885
Sorry about that. Confirmed; I'm working on a fix.
Candidate patch: https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00834.html
Author: dmalcolm Date: Tue Nov 13 15:59:57 2018 New Revision: 266079 URL: https://gcc.gnu.org/viewcvs?rev=266079&root=gcc&view=rev Log: Fix ICE with -fopt-info-inline (PR ipa/87955) PR ipa/87955 reports a problem I introduced in r265920, where I converted the guard in report_inline_failed_reason from using: if (dump_file) to using if (dump_enabled_p ()). without updating the calls to cl_target_option_print_diff and cl_optimization_print_diff, which assume that dump_file is non-NULL. The functions are auto-generated. Rather than porting them to the dump API, this patch applies the workaround of adding the missing checks on dump_file before calling them. gcc/ChangeLog: PR ipa/87955 * ipa-inline.c (report_inline_failed_reason): Guard calls to cl_target_option_print_diff and cl_optimization_print_diff with if (dump_file). gcc/testsuite/ChangeLog: PR ipa/87955 * gcc.target/i386/pr87955.c: New test. Added: trunk/gcc/testsuite/gcc.target/i386/pr87955.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-inline.c trunk/gcc/testsuite/ChangeLog
Should be fixed by r266079.
The new testcase FAILs on 32-bit Solaris/x86, FreeBSD, and Linux: +FAIL: gcc.target/i386/pr87955.c (test for errors, line 10) I suspect it needs to be restricted to target lp64?
Author: jakub Date: Mon Dec 10 13:30:49 2018 New Revision: 266954 URL: https://gcc.gnu.org/viewcvs?rev=266954&root=gcc&view=rev Log: PR ipa/87955 * gcc.target/i386/pr87955.c: Add -msse2 -mfpmath=sse to dg-options. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/i386/pr87955.c
Should be fixed now.