diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-20 22:14:41 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-20 22:14:41 +0000 |
commit | f16feee25a739555a76f0cd97aca0b2f8f267aa3 (patch) | |
tree | 86910b46650f770e82274e25d7d3f2c992409256 | |
parent | e4f51d19ea7e0a169e7efbce63cc8c62e71851bb (diff) | |
download | gcc-f16feee25a739555a76f0cd97aca0b2f8f267aa3.tar.gz |
* rtl.h (remove_reg_equal_equiv_notes): New prototype.
* rtlanal.c (remove_reg_equal_equiv_notes): New function.
* combine.c (adjust_for_new_dest): Use it.
* postreload.c (reload_combine): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122178 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/combine.c | 12 | ||||
-rw-r--r-- | gcc/postreload.c | 11 | ||||
-rw-r--r-- | gcc/rtl.h | 1 | ||||
-rw-r--r-- | gcc/rtlanal.c | 18 |
5 files changed, 28 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbb93b7a8df..0be8ba59122 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2007-02-20 Steven Bosscher <steven@gcc.gnu.org> + * rtl.h (remove_reg_equal_equiv_notes): New prototype. + * rtlanal.c (remove_reg_equal_equiv_notes): New function. + * combine.c (adjust_for_new_dest): Use it. + * postreload.c (reload_combine): Likewise. + +2007-02-20 Steven Bosscher <steven@gcc.gnu.org> + * rtlanal.c (find_reg_equal_equiv_note): Do not find REG_EQ* notes on an insn with multiple sets, even if single_set returns non-NULL for that insn. diff --git a/gcc/combine.c b/gcc/combine.c index 6605b7a3558..d1277d49639 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1726,18 +1726,8 @@ likely_spilled_retval_p (rtx insn) static void adjust_for_new_dest (rtx insn) { - rtx *loc; - /* For notes, be conservative and simply remove them. */ - loc = ®_NOTES (insn); - while (*loc) - { - enum reg_note kind = REG_NOTE_KIND (*loc); - if (kind == REG_EQUAL || kind == REG_EQUIV) - *loc = XEXP (*loc, 1); - else - loc = &XEXP (*loc, 1); - } + remove_reg_equal_equiv_notes (insn); /* The new insn will have a destination that was previously the destination of an insn just above it. Call distribute_links to make a LOG_LINK from diff --git a/gcc/postreload.c b/gcc/postreload.c index d1e58ab944d..47930ad042a 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -887,22 +887,13 @@ reload_combine (void) if (apply_change_group ()) { - rtx *np; - /* Delete the reg-reg addition. */ delete_insn (insn); if (reg_state[regno].offset != const0_rtx) /* Previous REG_EQUIV / REG_EQUAL notes for PREV are now invalid. */ - for (np = ®_NOTES (prev); *np;) - { - if (REG_NOTE_KIND (*np) == REG_EQUAL - || REG_NOTE_KIND (*np) == REG_EQUIV) - *np = XEXP (*np, 1); - else - np = &XEXP (*np, 1); - } + remove_reg_equal_equiv_notes (prev); reg_state[regno].use_index = RELOAD_COMBINE_MAX_USES; reg_state[REGNO (const_reg)].store_ruid diff --git a/gcc/rtl.h b/gcc/rtl.h index fdd582d5fd2..6bf09aa14a9 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1702,6 +1702,7 @@ extern int find_reg_fusage (rtx, enum rtx_code, rtx); extern int find_regno_fusage (rtx, enum rtx_code, unsigned int); extern int pure_call_p (rtx); extern void remove_note (rtx, rtx); +extern void remove_reg_equal_equiv_notes (rtx); extern int side_effects_p (rtx); extern int volatile_refs_p (rtx); extern int volatile_insn_p (rtx); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index b23eec4cf9f..00a996e4696 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1820,6 +1820,24 @@ remove_note (rtx insn, rtx note) gcc_unreachable (); } +/* Remove REG_EQUAL and/or REG_EQUIV notes if INSN has such notes. */ + +void +remove_reg_equal_equiv_notes (rtx insn) +{ + rtx *loc; + + loc = ®_NOTES (insn); + while (*loc) + { + enum reg_note kind = REG_NOTE_KIND (*loc); + if (kind == REG_EQUAL || kind == REG_EQUIV) + *loc = XEXP (*loc, 1); + else + loc = &XEXP (*loc, 1); + } +} + /* Search LISTP (an EXPR_LIST) for an entry whose first operand is NODE and return 1 if it is found. A simple equality test is used to determine if NODE matches. */ |