https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64730
Bug ID: 64730 Summary: g++.dg/ipa/pr64049-1.C ICE: SEGV when printing NULL Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org Host: *-*-solaris2.10 Target: *-*-solaris2.10 Build: *-*-solaris2.10 As reported in https://gcc.gnu.org/ml/gcc-patches/2015-01/msg01889.html this change 2015-01-15 Naveen H.S <naveen.hurugalaw...@caviumnetworks.com> * ipa-inline.c (inline_small_functions): Swap the operands in enum. caused a couple of testsuite failures on Solaris 10: FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++11 (internal compiler error) FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++11 (test for excess errors) FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++14 (internal compiler error) FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++14 (test for excess errors) FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++98 (internal compiler error) FAIL: g++.dg/ipa/pr64049-1.C -std=gnu++98 (test for excess errors) /vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/ipa/pr64049-1.C:34:1: internal compiler error: Segmentation Fault 0x88b777c crash_signal /vol/gcc/src/hg/trunk/local/gcc/toplev.c:381 cc1plus -fpreprocessed pr64049-1.ii -quiet -O3 -fdump-ipa-inline -o pr64049-1.s Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1 (LWP 1)] 0xfee0645c in strlen () from /lib/libc.so.1 (gdb) where #0 0xfee0645c in strlen () from /lib/libc.so.1 #1 0xfee61aee in _ndoprnt () from /lib/libc.so.1 #2 0xfee6469e in fprintf () from /lib/libc.so.1 #3 0x08ed5f04 in inline_small_functions () at /vol/gcc/src/hg/trunk/local/gcc/ipa-inline.c:1718 #4 0x08ed84e4 in ipa_inline () at /vol/gcc/src/hg/trunk/local/gcc/ipa-inline.c:2178 #5 (anonymous namespace)::pass_ipa_inline::execute (this=<optimized out>) at /vol/gcc/src/hg/trunk/local/gcc/ipa-inline.c:2550 #6 0x087f94b3 in execute_one_pass (pass=0x98f7fd0) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2326 #7 0x087f9fdd in execute_ipa_pass_list (pass=0x98f7fd0) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2723 #8 0x0850cd02 in ipa_passes () at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2133 #9 symbol_table::compile (this=this@entry=0xfea09000) at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2221 #10 0x0850eda7 in compile (this=0xfea09000) at /vol/gcc/src/hg/trunk/local/gcc/timevar.h:110 #11 symbol_table::finalize_compilation_unit (this=0xfea09000) at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2370 #12 0x082fcd2e in cp_write_global_declarations () at /vol/gcc/src/hg/trunk/local/gcc/cp/decl2.c:4750 #13 0x088b7819 in compile_file () at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:606 #14 0x091fa5e9 in do_compile () at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2045 #15 toplev::main (this=0x804759f, argc=8, argv=0x80475e0) at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2142 #16 0x091fb27f in main (argc=8, argv=0x80475e0) at /vol/gcc/src/hg/trunk/local/gcc/main.c:38 On Solaris 11 and Linux, I find Considering static EnumStatusCode ValueHelper::getLocalizedText(const ValueStruct*, LocalizedText&)/26 with 17 size to be inlined into static LocalizedText ValueHelper::getLocalizedText(const ValueStruct*)/15 in (null):0 i.e. fprintf(NULL), which doesn't work in every libc. Rainer