diff options
author | Richard Henderson <rth@redhat.com> | 2011-08-02 15:18:35 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2011-08-02 15:18:35 -0700 |
commit | 9a08d23082fbeb95013dc74dd3611b6b2331e3cb (patch) | |
tree | 3dd838d8e7cbbe356e3db0a0c2bcb80fcfbb4daf /gcc/reload1.c | |
parent | cde7b553dbabe7d7341998f54979af2190539cd7 (diff) | |
download | gcc-9a08d23082fbeb95013dc74dd3611b6b2331e3cb.tar.gz |
re PR debug/49864 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439)
PR target/49864
* reg-notes.def (REG_ARGS_SIZE): New.
* calls.c (emit_call_1): Emit REG_ARGS_SIZE for call_pop.
(expand_call): Add REG_ARGS_SIZE to emit_stack_restore.
* cfgcleanup.c (old_insns_match_p): Don't allow cross-jumping to
different stack levels.
* combine-stack-adj.c (adjust_frame_related_expr): Remove.
(maybe_move_args_size_note): New.
(combine_stack_adjustments_for_block): Use it.
* combine.c (distribute_notes): Place REG_ARGS_SIZE.
* dwarf2cfi.c (dw_cfi_row_struct): Remove args_size member.
(dw_trace_info): Add beg_true_args_size, end_true_args_size,
beg_delay_args_size, end_delay_args_size, eh_head, args_size_undefined.
(cur_cfa): New.
(queued_args_size): Remove.
(add_cfi_args_size): Assert size is non-negative.
(stack_adjust_offset, dwarf2out_args_size): Remove.
(dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust): Remove.
(notice_args_size, notice_eh_throw): New.
(dwarf2out_frame_debug_def_cfa): Use cur_cfa.
(dwarf2out_frame_debug_adjust_cfa): Likewise.
(dwarf2out_frame_debug_cfa_offset): Likewise.
(dwarf2out_frame_debug_expr): Likewise. Don't stack_adjust_offset.
(dwarf2out_frame_debug): Don't handle non-frame-related-p insns.
(change_cfi_row): Don't emit args_size.
(maybe_record_trace_start_abnormal): Split out from ...
(maybe_record_trace_start): Here. Set args_size_undefined.
(create_trace_edges): Update to match.
(scan_trace): Handle REG_ARGS_SIZE.
(connect_traces): Connect args_size between EH insns.
* emit-rtl.c (try_split): Handle REG_ARGS_SIZE.
* explow.c (suppress_reg_args_size): New.
(adjust_stack_1): Split out from ...
(adjust_stack): ... here.
(anti_adjust_stack): Use it.
(allocate_dynamic_stack_space): Suppress REG_ARGS_SIZE.
* expr.c (mem_autoinc_base): New.
(fixup_args_size_notes): New.
(emit_single_push_insn_1): Rename from emit_single_push_insn.
(emit_single_push_insn): New. Generate REG_ARGS_SIZE.
* recog.c (peep2_attempt): Handle REG_ARGS_SIZE.
* reload1.c (reload_as_needed): Likewise.
* rtl.h (fixup_args_size_notes): Declare.
From-SVN: r177218
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 499412c0ba4..ba6ce37da9d 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -4548,7 +4548,7 @@ reload_as_needed (int live_known) #if defined (AUTO_INC_DEC) int i; #endif - rtx x; + rtx x, marker; memset (spill_reg_rtx, 0, sizeof spill_reg_rtx); memset (spill_reg_store, 0, sizeof spill_reg_store); @@ -4559,6 +4559,10 @@ reload_as_needed (int live_known) set_initial_elim_offsets (); + /* Generate a marker insn that we will move around. */ + marker = emit_note (NOTE_INSN_DELETED); + unlink_insn_chain (marker, marker); + for (chain = reload_insn_chain; chain; chain = chain->next) { rtx prev = 0; @@ -4631,7 +4635,10 @@ reload_as_needed (int live_known) rtx next = NEXT_INSN (insn); rtx p; + /* ??? PREV can get deleted by reload inheritance. + Work around this by emitting a marker note. */ prev = PREV_INSN (insn); + reorder_insns_nobb (marker, marker, prev); /* Now compute which reload regs to reload them into. Perhaps reusing reload regs from previous insns, or else output @@ -4649,10 +4656,22 @@ reload_as_needed (int live_known) and that we moved the structure into). */ subst_reloads (insn); + prev = PREV_INSN (marker); + unlink_insn_chain (marker, marker); + /* Adjust the exception region notes for loads and stores. */ if (cfun->can_throw_non_call_exceptions && !CALL_P (insn)) fixup_eh_region_note (insn, prev, next); + /* Adjust the location of REG_ARGS_SIZE. */ + p = find_reg_note (insn, REG_ARGS_SIZE, NULL_RTX); + if (p) + { + remove_note (insn, p); + fixup_args_size_notes (prev, PREV_INSN (next), + INTVAL (XEXP (p, 0))); + } + /* If this was an ASM, make sure that all the reload insns we have generated are valid. If not, give an error and delete them. */ |