From 1c9b6043f9e53d7bfb394151eee5a7b25918364b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 5 Sep 2014 14:47:02 +0000 Subject: [PATCH] Use rtx_insn more within peep2 gcc/ChangeLog: 2014-09-05 David Malcolm * recog.c (peep2_attempt): Strengthen return type from rtx to rtx_insn *. (peep2_update_life): Likewise for params "last", "prev", removing a checked cast made redundant by this. (peephole2_optimize): Likewise for local "last". From-SVN: r214966 --- gcc/ChangeLog | 8 ++++++++ gcc/recog.c | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a7e49957ae..48c0bcd2bd2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-09-05 David Malcolm + + * recog.c (peep2_attempt): Strengthen return type from rtx to + rtx_insn *. + (peep2_update_life): Likewise for params "last", "prev", removing + a checked cast made redundant by this. + (peephole2_optimize): Likewise for local "last". + 2014-09-05 David Malcolm * basic-block.h (set_block_for_insn): Eliminate this macro in diff --git a/gcc/recog.c b/gcc/recog.c index 469dfe68a08..d07a57a7d25 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3160,7 +3160,7 @@ peep2_reinit_state (regset live) replacing them with ATTEMPT. Returns the last insn emitted, or NULL if the replacement is rejected. */ -static rtx +static rtx_insn * peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt) { rtx_insn *insn = safe_as_a (uncast_insn); @@ -3396,7 +3396,8 @@ peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt matched, and which now need to be replaced in the buffer. */ static void -peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) +peep2_update_life (basic_block bb, int match_len, rtx_insn *last, + rtx_insn *prev) { int i = peep2_buf_position (peep2_current + match_len + 1); rtx_insn *x; @@ -3408,7 +3409,7 @@ peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) gcc_assert (peep2_current_count >= match_len + 1); peep2_current_count -= match_len + 1; - x = as_a (last); + x = last; do { if (INSN_P (x)) @@ -3538,7 +3539,7 @@ peephole2_optimize (void) peephole2_insns (PATTERN (head), head, &match_len)); if (attempt != NULL) { - rtx last = peep2_attempt (bb, head, match_len, attempt); + rtx_insn *last = peep2_attempt (bb, head, match_len, attempt); if (last) { peep2_update_life (bb, match_len, last, PREV_INSN (attempt)); -- 2.30.2