diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-09-05 14:47:02 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-09-05 14:47:02 +0000 |
commit | 1c9b6043f9e53d7bfb394151eee5a7b25918364b (patch) | |
tree | 7350194b70d06e07a645a72d4b263057b3b0f425 | |
parent | a7188cc6500d6805a4d8de9d74ecc6d728d4af33 (diff) | |
download | gcc-1c9b6043f9e53d7bfb394151eee5a7b25918364b.zip gcc-1c9b6043f9e53d7bfb394151eee5a7b25918364b.tar.gz gcc-1c9b6043f9e53d7bfb394151eee5a7b25918364b.tar.bz2 |
Use rtx_insn more within peep2
gcc/ChangeLog:
2014-09-05 David Malcolm <dmalcolm@redhat.com>
* 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
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/recog.c | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a7e499..48c0bcd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2014-09-05 David Malcolm <dmalcolm@redhat.com> + * 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 <dmalcolm@redhat.com> + * basic-block.h (set_block_for_insn): Eliminate this macro in favor of... * rtl.h (set_block_for_insn): New inline function, imposing the diff --git a/gcc/recog.c b/gcc/recog.c index 469dfe6..d07a57a 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 <rtx_insn *> (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 <rtx_insn *> (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)); |