https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85401
Bug ID: 85401 Summary: segfault building code for VAX Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: coypu at sdf dot org Target Milestone: --- Created attachment 43929 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43929&action=edit Reproduce test build with the following flags fails: -O2 -fno-pic -c ip_icmp.i here is a backtrace, from trunk as of April 14 2018. Starting program: /home/fly/gcc/build/gcc/cc1 -fpreprocessed ip_icmp.i -quiet -dumpbase ip_icmp.i -auxbase ip_icmp -O2 -fno-pic -o /var/tmp//ccO5AxRb.s In file included from ../../../../sys/timevar.h:66, from ../../../../sys/time.h:307, from ../../../../sys/param.h:145, from ../../../../netinet/ip_icmp.c:103: ../../../../sys/systm.h:225:6: warning: conflicting types for built-in function 'printf' [-Wbuiltin-declaration-mismatch] ../../../../sys/systm.h:229:6: warning: conflicting types for built-in function 'vprintf' [-Wbuiltin-declaration-mismatch] In file included from ../../../../netinet/ip_icmp.c:112: ../../../../sys/syslog.h:233:6: warning: conflicting types for built-in function 'log' [-Wbuiltin-declaration-mismatch] Program received signal SIGSEGV, Segmentation fault. 0x0000000000bfd868 in allocno_copy_cost_saving (allocno=0x7e3c3e791190, hard_regno=11) at ../../gcc/ira-color.c:2832 2832 cost += cp->freq * ira_register_move_cost[allocno_mode][rclass][rclass]; 1: rclass = ALL_REGS 2: allocno_mode = E_QImode 3: ira_register_move_cost[allocno_mode][rclass][rclass] = <error: Cannot access memory at address 0x6> 4: cp->freq = 36 5: ira_register_move_cost = {0x0, 0x0, 0x0, 0x0, 0x0, 0x7e3c3ed98850, 0x7e3c3ed98850, 0x0 <repeats 32 times>} (gdb) bt full #0 0x0000000000bfd868 in allocno_copy_cost_saving (allocno=0x7e3c3e791190, hard_regno=11) at ../../gcc/ira-color.c:2832 cost = 0 allocno_mode = E_QImode rclass = ALL_REGS cp = 0x7e3c3e511380 next_cp = 0x0 __FUNCTION__ = "allocno_copy_cost_saving" #1 0x0000000000bfdbb9 in improve_allocation () at ../../gcc/ira-color.c:2905 i = 2 j = 11 k = 11 n = 5 hregno = 11 conflict_hregno = 1 base_cost = 2232 class_size = 12 word = 1 nwords = 1 check = 3 spill_cost = 4068 min_cost = -594 nregs = 1 conflict_nregs = 1 r = 2 best = 10 try_p = true aclass = ALL_REGS mode = E_SImode allocno_costs = 0x7e3c3e7313c8 costs = {-1740536, 40443, 0, 484, 552, 0, -2232, -2232, -2232, -2232, -2232, 0, 1050933376, 32316, -1741856, 32639} conflicting_regs = {18446744073709547521, 140187730799504} profitable_hard_regs = 4032 a = 0x7e3c3e791190 bi = {elt1 = 0x7e3c3e7b1a90, elt2 = 0x0, word_no = 0, bits = 4611686018427387903} __FUNCTION__ = "improve_allocation" #2 0x0000000000bfea51 in color_allocnos () at ../../gcc/ira-color.c:3201 i = 256 n = 32316 bi = {elt1 = 0x0, elt2 = 0x0, word_no = 2, bits = 0} a = 0x7e3c3e799050 __FUNCTION__ = "color_allocnos" #3 0x0000000000bff13f in color_pass (loop_tree_node=0x7e3c3ed2fc00) at ../../gcc/ira-color.c:3310 regno = 32316 hard_regno = -1741504 index = -1 n = 81 cost = 0 exit_freq = 1048255088 enter_freq = 0 j = 256 bi = {elt1 = 0x0, elt2 = 0x0, word_no = 2, bits = 0} mode = 32639 rclass = NO_REGS aclass = (unknown: 33152352) pclass = (ALL_REGS | LIM_REG_CLASSES | unknown: 9049864) a = 0x7e3c3e799050 subloop_allocno = 0xb8 subloop_node = 0x7f7fffe56d20 __FUNCTION__ = "color_pass" #4 0x0000000000be8146 in ira_traverse_loop_tree (bb_p=false, loop_node=0x7e3c3ed2fc00, preorder_func=0xbfef25 <color_pass(ira_loop_tree_node_t)>, postorder_func=0x0) at ../../gcc/ira-build.c:1781 subloop_node = 0xbd6ab8 <ira_allocate_bitmap()+14> __FUNCTION__ = "ira_traverse_loop_tree" #5 0x0000000000bffa0d in do_coloring () at ../../gcc/ira-color.c:3461 No locals. #6 0x0000000000c03501 in color () at ../../gcc/ira-color.c:4838 No locals. #7 0x0000000000c039d3 in ira_color () at ../../gcc/ira-color.c:4953 a = 0x7e3c3e799050 ai = {n = 172} #8 0x0000000000be30ff in ira (f=0x0) at ../../gcc/ira.c:5308 loops_p = true ira_max_point_before_emit = 524288 saved_flag_caller_saves = true saved_flag_ira_region = IRA_REGION_MIXED __FUNCTION__ = "ira" #9 0x0000000000be3887 in (anonymous namespace)::pass_ira::execute (this=0x7e3c3ed86bc0) at ../../gcc/ira.c:5606 No locals. #10 0x0000000000d142af in execute_one_pass (pass=0x7e3c3ed86bc0) at ../../gcc/passes.c:2497 todo_after = 0 gate_status = true __FUNCTION__ = "execute_one_pass" #11 0x0000000000d14600 in execute_pass_list_1 (pass=0x7e3c3ed86bc0) at ../../gcc/passes.c:2586 __FUNCTION__ = "execute_pass_list_1" #12 0x0000000000d14631 in execute_pass_list_1 (pass=0x7e3c3ed85ac0) at ../../gcc/passes.c:2587 __FUNCTION__ = "execute_pass_list_1" #13 0x0000000000d14689 in execute_pass_list (fn=0x7e3c3e64c790, pass=0x7e3c3ed82080) at ../../gcc/passes.c:2597 __FUNCTION__ = "execute_pass_list" #14 0x0000000000935b0e in cgraph_node::expand (this=0x7e3c3e68c730) at ../../gcc/cgraphunit.c:2139 saved_loc = 62585088 __FUNCTION__ = "expand" #15 0x0000000000936149 in expand_all_functions () at ../../gcc/cgraphunit.c:2275 node = 0x7e3c3e68c730 order = 0x7e3c3ed2d800 expanded_func_count = 11 profiled_func_count = 0 order_pos = 96 new_order_pos = 18 i = 7 __FUNCTION__ = "expand_all_functions" #16 0x0000000000936c95 in symbol_table::compile (this=0x7e3c3eb06000) at ../../gcc/cgraphunit.c:2624 No locals. #17 0x0000000000936eff in symbol_table::finalize_compilation_unit (this=0x7e3c3eb06000) at ../../gcc/cgraphunit.c:2717 No locals. #18 0x0000000000dfc753 in compile_file () at ../../gcc/toplev.c:480 No locals. #19 0x0000000000dfefad in do_compile () at ../../gcc/toplev.c:2132 i = 1 #20 0x0000000000dff289 in toplev::main (this=0x7f7fffe570ce, argc=12, argv=0x7f7fffe57120) at ../../gcc/toplev.c:2267 __FUNCTION__ = "main" #21 0x000000000156cd6f in main (argc=12, argv=0x7f7fffe57120) at ../../gcc/main.c:39 toplev = {m_use_TV_TOTAL = true, m_init_signals = true}