diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-05-09 20:02:13 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-05-09 20:02:13 +0000 |
commit | 909b40107406b30c899ce55c127d8761e8b09ca8 (patch) | |
tree | 29a0f0a6c79a69ecc64f612947a0fe5904311713 /contrib/gcc/reorg.c | |
parent | 1952e2e1c1be6f107fa3ce8b10025cfd1cd7943b (diff) |
Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.
Notes
Notes:
svn path=/vendor/gcc/dist/; revision=96263
Diffstat (limited to 'contrib/gcc/reorg.c')
-rw-r--r-- | contrib/gcc/reorg.c | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/contrib/gcc/reorg.c b/contrib/gcc/reorg.c index b1c33f5bf0df..659fc007590e 100644 --- a/contrib/gcc/reorg.c +++ b/contrib/gcc/reorg.c @@ -511,7 +511,8 @@ emit_delay_sequence (insn, list, length) case REG_LABEL: /* Keep the label reference count up to date. */ - LABEL_NUSES (XEXP (note, 0)) ++; + if (GET_CODE (XEXP (note, 0)) == CODE_LABEL) + LABEL_NUSES (XEXP (note, 0)) ++; break; default: @@ -749,7 +750,8 @@ optimize_skip (insn) || GET_CODE (PATTERN (trial)) == SEQUENCE || recog_memoized (trial) < 0 || (! eligible_for_annul_false (insn, 0, trial, flags) - && ! eligible_for_annul_true (insn, 0, trial, flags))) + && ! eligible_for_annul_true (insn, 0, trial, flags)) + || can_throw_internal (trial)) return 0; /* There are two cases where we are just executing one insn (we assume @@ -1085,9 +1087,14 @@ get_branch_condition (insn, target) || (GET_CODE (XEXP (src, 2)) == LABEL_REF && XEXP (XEXP (src, 2), 0) == target)) && XEXP (src, 1) == pc_rtx) - return gen_rtx_fmt_ee (reverse_condition (GET_CODE (XEXP (src, 0))), - GET_MODE (XEXP (src, 0)), - XEXP (XEXP (src, 0), 0), XEXP (XEXP (src, 0), 1)); + { + enum rtx_code rev; + rev = reversed_comparison_code (XEXP (src, 0), insn); + if (rev != UNKNOWN) + return gen_rtx_fmt_ee (rev, GET_MODE (XEXP (src, 0)), + XEXP (XEXP (src, 0), 0), + XEXP (XEXP (src, 0), 1)); + } return 0; } @@ -2121,7 +2128,8 @@ fill_simple_delay_slots (non_jumps_p) && GET_CODE (trial) == JUMP_INSN && simplejump_p (trial) && eligible_for_delay (insn, slots_filled, trial, flags) - && no_labels_between_p (insn, trial)) + && no_labels_between_p (insn, trial) + && ! can_throw_internal (trial)) { rtx *tmp; slots_filled++; @@ -2191,7 +2199,7 @@ fill_simple_delay_slots (non_jumps_p) /* Can't separate set of cc0 from its use. */ && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)) #endif - ) + && ! can_throw_internal (trial)) { trial = try_split (pat, trial, 1); next_trial = prev_nonnote_insn (trial); @@ -2267,7 +2275,7 @@ fill_simple_delay_slots (non_jumps_p) Presumably, we should also check to see if we could get back to this function via `setjmp'. */ - && !can_throw_internal (insn) + && ! can_throw_internal (insn) && (GET_CODE (insn) != JUMP_INSN || ((condjump_p (insn) || condjump_in_parallel_p (insn)) && ! simplejump_p (insn) @@ -2334,7 +2342,8 @@ fill_simple_delay_slots (non_jumps_p) #endif && ! (maybe_never && may_trap_p (pat)) && (trial = try_split (pat, trial, 0)) - && eligible_for_delay (insn, slots_filled, trial, flags)) + && eligible_for_delay (insn, slots_filled, trial, flags) + && ! can_throw_internal(trial)) { next_trial = next_nonnote_insn (trial); delay_list = add_to_delay_list (trial, delay_list); @@ -2386,7 +2395,8 @@ fill_simple_delay_slots (non_jumps_p) #endif && ! (maybe_never && may_trap_p (PATTERN (next_trial))) && (next_trial = try_split (PATTERN (next_trial), next_trial, 0)) - && eligible_for_delay (insn, slots_filled, next_trial, flags)) + && eligible_for_delay (insn, slots_filled, next_trial, flags) + && ! can_throw_internal (trial)) { rtx new_label = next_active_insn (next_trial); @@ -2490,7 +2500,7 @@ fill_simple_delay_slots (non_jumps_p) /* Don't want to mess with cc0 here. */ && ! reg_mentioned_p (cc0_rtx, pat) #endif - ) + && ! can_throw_internal (trial)) { trial = try_split (pat, trial, 1); if (ELIGIBLE_FOR_EPILOGUE_DELAY (trial, slots_filled)) @@ -2631,7 +2641,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely, && ! (reg_mentioned_p (cc0_rtx, pat) && (! own_thread || ! sets_cc0_p (pat))) #endif - ) + && ! can_throw_internal (trial)) { rtx prior_insn; @@ -2732,12 +2742,13 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely, temporarily increment the use count on any referenced label lest it be deleted by delete_related_insns. */ note = find_reg_note (trial, REG_LABEL, 0); - if (note) + /* REG_LABEL could be NOTE_INSN_DELETED_LABEL too. */ + if (note && GET_CODE (XEXP (note, 0)) == CODE_LABEL) LABEL_NUSES (XEXP (note, 0))++; delete_related_insns (trial); - if (note) + if (note && GET_CODE (XEXP (note, 0)) == CODE_LABEL) LABEL_NUSES (XEXP (note, 0))--; } else @@ -2867,8 +2878,10 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely, trial = new_thread; pat = PATTERN (trial); - if (GET_CODE (trial) != INSN || GET_CODE (pat) != SET - || ! eligible_for_delay (insn, 0, trial, flags)) + if (GET_CODE (trial) != INSN + || GET_CODE (pat) != SET + || ! eligible_for_delay (insn, 0, trial, flags) + || can_throw_internal (trial)) return 0; dest = SET_DEST (pat), src = SET_SRC (pat); @@ -3279,7 +3292,8 @@ relax_delay_slots (first) insn, redirect the jump to the following insn process again. */ trial = next_active_insn (target_label); if (trial && GET_CODE (PATTERN (trial)) != SEQUENCE - && redundant_insn (trial, insn, 0)) + && redundant_insn (trial, insn, 0) + && ! can_throw_internal (trial)) { rtx tmp; @@ -3684,10 +3698,6 @@ dbr_schedule (first, file) /* It is not clear why the line below is needed, but it does seem to be. */ unfilled_firstobj = (rtx *) obstack_alloc (&unfilled_slots_obstack, 0); - /* Reposition the prologue and epilogue notes in case we moved the - prologue/epilogue insns. */ - reposition_prologue_and_epilogue_notes (first); - if (file) { int i, j, need_comma; |