http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52095
Bug #: 52095 Summary: [4.7 regression] ICE compiling gcc.dg/sms-7.c: SEGV in fprintf Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: r...@gcc.gnu.org Host: i386-pc-solaris2.10 Target: i386-pc-solaris2.10 Build: i386-pc-solaris2.10 Since 20111213, gcc.dg/sms-7.c FAILs on Solaris 10/x86, both 32 and 64-bit: FAIL: gcc.dg/sms-7.c (internal compiler error) FAIL: gcc.dg/sms-7.c (test for excess errors) WARNING: gcc.dg/sms-7.c compilation failed to produce executable Running cc1 $ cc1 -fpreprocessed sms-7.i -quiet -mtune=generic -march=pentium4 -O3 -fmodulo-sched -fstrict-aliasing -fdump-rtl-sms -fmodulo-sched-allow-regmoves --param sms-min-sc=1 -o sms-7.s gives: /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/sms-7.c: In function 'main': /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/sms-7.c:45:1: internal compiler error: Segmentation Fault With gdb, I find: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1 (LWP 1)] 0xfee063dc in strlen () from /lib/libc.so.1 (gdb) where #0 0xfee063dc in strlen () from /lib/libc.so.1 #1 0xfee6169a in _ndoprnt () from /lib/libc.so.1 #2 0xfee64229 in fprintf () from /lib/libc.so.1 #3 0x088689b0 in sms_schedule () at /vol/gcc/src/hg/trunk/local/gcc/modulo-sched.c:1414 #4 rest_of_handle_sms () at /vol/gcc/src/hg/trunk/local/gcc/modulo-sched.c:3338 #5 0x083bb744 in execute_one_pass (pass=pass@entry=0x8d82be0) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2081 #6 0x083bba9d in execute_pass_list (pass=0x8d82be0) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2136 #7 0x083bbab0 in execute_pass_list (pass=0x8d7f0a0) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2137 #8 0x08497e86 in tree_rest_of_compilation (fndecl=0xfeaaa780) at /vol/gcc/src/hg/trunk/local/gcc/tree-optimize.c:422 #9 0x0822ff07 in cgraph_expand_function (node=0xfea0e47c) at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:1819 #10 0x08231795 in cgraph_expand_all_functions () at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:1886 #11 cgraph_optimize () at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2200 #12 0x08231cbf in cgraph_finalize_compilation_unit () at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:1328 #13 0x0816dc1c in c_write_global_declarations () at /vol/gcc/src/hg/trunk/local/gcc/c-decl.c:10030 #14 0x0845241b in compile_file () at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:573 #15 do_compile () at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:1938 #16 toplev_main (argc=15, argv=0x80474c0) at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2014 #17 0x08af940b in main (argc=15, argv=0x80474c0) at /vol/gcc/src/hg/trunk/local/gcc/main.c:36 It turns out that sms_schedule calls fprintf with a NULL ptr since insn_file(insn) is NULL at this point. This is a regression from 4.6. Rainer