http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52997
Bug #: 52997 Summary: [4.8 Regression] FAIL: gcc.dg/c99-intconst-1.c (internal compiler error) Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: dang...@gcc.gnu.org CC: ber...@gcc.gnu.org Host: hppa-unknown-linux-gnu Target: hppa-unknown-linux-gnu Build: hppa-unknown-linux-gnu Compiler generates a segmentation fault in reload1.c: Program received signal SIGSEGV, Segmentation fault. 0x004ac200 in calculate_elim_costs_all_insns () at ../../gcc/gcc/reload1.c:1636 1636 && reg_renumber[REGNO (SET_DEST (set))] < 0 (gdb) bt #0 0x004ac200 in calculate_elim_costs_all_insns () at ../../gcc/gcc/reload1.c:1636 #1 0x003eaca0 in ira_costs () at ../../gcc/gcc/ira-costs.c:2061 #2 0x003e5604 in ira_build () at ../../gcc/gcc/ira-build.c:3076 #3 0x003df6a8 in ira (f=<optimized out>) at ../../gcc/gcc/ira.c:4142 #4 rest_of_handle_ira () at ../../gcc/gcc/ira.c:4315 #5 0x00459764 in execute_one_pass (pass=0x15cccd8) at ../../gcc/gcc/passes.c:2079 #6 0x004599e8 in execute_pass_list (pass=0x0) at ../../gcc/gcc/passes.c:2134 #7 0x004599fc in execute_pass_list (pass=0xa25410) at ../../gcc/gcc/passes.c:2135 #8 0x001ca47c in tree_rest_of_compilation (node=<optimized out>) at ../../gcc/gcc/cgraphunit.c:1806 #9 0x001ca888 in cgraph_expand_function (node=0x4076b500) at ../../gcc/gcc/cgraphunit.c:1876 #10 0x001ccd28 in cgraph_output_in_order () at ../../gcc/gcc/cgraphunit.c:2041 #11 cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:2629 #12 0x001cd08c in cgraph_finalize_compilation_unit () at ../../gcc/gcc/cgraphunit.c:2720 #13 0x001cd08c in cgraph_finalize_compilation_unit () at ../../gcc/gcc/cgraphunit.c:2720 (gdb) disass $pc-16,$pc+16 Dump of assembler code from 0x4ac1f0 to 0x4ac210: 0x004ac1f0 <calculate_elim_costs_all_insns+360>: cmpb,<>,n r20,r21,0x4ac388 <calculate_elim_costs_all_insns+768> 0x004ac1f4 <calculate_elim_costs_all_insns+364>: ldw 4(r19),r4 0x004ac1f8 <calculate_elim_costs_all_insns+368>: addil L%2a800,dp,r1 0x004ac1fc <calculate_elim_costs_all_insns+372>: ldw 308(r1),r19 => 0x004ac200 <calculate_elim_costs_all_insns+376>: ldh,s r4(r19),r19 0x004ac204 <calculate_elim_costs_all_insns+380>: extrw,s r19,31,16,r19 0x004ac208 <calculate_elim_costs_all_insns+384>: cmpib,<= 0,r19,0x4ac388 <calculate_elim_costs_all_insns+768> 0x004ac20c <calculate_elim_costs_all_insns+388>: addil L%7c000,dp,r1 End of assembler dump. (gdb) p/x $r19 $1 = 0x4061a008 (gdb) p/x $r4 $2 = 0x20ffc (gdb) p/x reg_renumber $4 = 0x4061a008 (gdb) p debug_rtx (set) (set (reg:SI 135164 [3982]) (const_int 16384 [0x4000])) $5 = void (gdb) p/x 135164 $6 = 0x20ffc (gdb) p/x ®_renumber[135164] $7 = 0x4065c000 (gdb) p reg_renumber[135164] Cannot access memory at address 0x4065c000 Apr 15 13:21:44 mx3210 kernel: do_page_fault() pid=14445 command='cc1' type=15 a ddress=0x4065c000Apr 15 13:21:44 mx3210 kernel: vm_start = 0x4051a000, vm_end = 0x4065c000 The register number causes an access beyond the region allocated for reg_renumber. The bug was introduced in r186378.