From: dmalcolm Date: Fri, 5 Sep 2014 15:03:12 +0000 (+0000) Subject: Simplification within reorg.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d77c5bc0de6cd05c6d86571605556d99fb7e2371;p=thirdparty%2Fgcc.git Simplification within reorg.c gcc/ChangeLog: 2014-09-05 David Malcolm * reorg.c (relax_delay_slots): Move declaration of "trial_seq" above the conditional, and convert the check on GET_CODE to a dyn_cast, so that "trial_seq" is available as an rtx_sequence * in the conditional. Simplify the conditional by using methods of "trial_seq". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214969 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e0eca46494b4..19299907750d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-09-05 David Malcolm + + * reorg.c (relax_delay_slots): Move declaration of "trial_seq" + above the conditional, and convert the check on GET_CODE to a + dyn_cast, so that "trial_seq" is available as an rtx_sequence * in + the conditional. Simplify the conditional by using methods of + "trial_seq". + 2014-09-05 David Malcolm * haifa-sched.c (check_clobbered_conditions): Strengthen local diff --git a/gcc/reorg.c b/gcc/reorg.c index 89d500da0660..7bacc6dc9a3f 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -3385,13 +3385,14 @@ relax_delay_slots (rtx_insn *first) /* Similarly, if it is an unconditional jump with one insn in its delay list and that insn is redundant, thread the jump. */ - if (trial && GET_CODE (PATTERN (trial)) == SEQUENCE - && XVECLEN (PATTERN (trial), 0) == 2 - && JUMP_P (XVECEXP (PATTERN (trial), 0, 0)) - && simplejump_or_return_p (XVECEXP (PATTERN (trial), 0, 0)) - && redundant_insn (XVECEXP (PATTERN (trial), 0, 1), insn, 0)) + rtx_sequence *trial_seq = + trial ? dyn_cast (PATTERN (trial)) : NULL; + if (trial_seq + && trial_seq->len () == 2 + && JUMP_P (trial_seq->insn (0)) + && simplejump_or_return_p (trial_seq->insn (0)) + && redundant_insn (trial_seq->insn (1), insn, 0)) { - rtx_sequence *trial_seq = as_a (PATTERN (trial)); target_label = JUMP_LABEL (trial_seq->insn (0)); if (ANY_RETURN_P (target_label)) target_label = find_end_label (target_label);