summaryrefslogtreecommitdiffstats
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-14 20:15:13 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-14 20:15:13 +0000
commit53fffe66067d85062e7736d487e94049ffccc644 (patch)
tree3085a6e478e08536454831e0b1720bcba93526a0 /gcc/rtlanal.c
parentea0ebc5e7c406ca02b86e7ad13ae4ae16d52b001 (diff)
downloadppe42-gcc-53fffe66067d85062e7736d487e94049ffccc644.tar.gz
ppe42-gcc-53fffe66067d85062e7736d487e94049ffccc644.zip
* cselib.c (clear_table): Do not take argument; always clear just
used slots. (cselib_process_insn): Update call of clear_table (cselib_init): Do not call clear_table. (cselib_finish): Clear table. * cse.c (count_reg_usage): Do not check side_effects_p. * rtlanal.c (set_noop_p): Check side_effects_p only when set looks like noop. (find_reg_equal_equiv_note): Do not use find_reg_note. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64369 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index d4817183c4e..4e604172f66 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1327,19 +1327,17 @@ set_noop_p (set)
rtx src = SET_SRC (set);
rtx dst = SET_DEST (set);
- if (side_effects_p (src) || side_effects_p (dst))
- return 0;
-
- if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
- return rtx_equal_p (dst, src);
-
if (dst == pc_rtx && src == pc_rtx)
return 1;
+ if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
+ return rtx_equal_p (dst, src) && !side_effects_p (dst);
+
if (GET_CODE (dst) == SIGN_EXTRACT
|| GET_CODE (dst) == ZERO_EXTRACT)
return rtx_equal_p (XEXP (dst, 0), src)
- && ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx;
+ && ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx
+ && !side_effects_p (src);
if (GET_CODE (dst) == STRICT_LOW_PART)
dst = XEXP (dst, 0);
@@ -2018,14 +2016,19 @@ rtx
find_reg_equal_equiv_note (insn)
rtx insn;
{
- rtx note;
+ rtx link;
- if (single_set (insn) == 0)
+ if (!INSN_P (insn))
return 0;
- else if ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
- return note;
- else
- return find_reg_note (insn, REG_EQUAL, NULL_RTX);
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_EQUAL
+ || REG_NOTE_KIND (link) == REG_EQUIV)
+ {
+ if (single_set (insn) == 0)
+ return 0;
+ return link;
+ }
+ return NULL;
}
/* Return true if DATUM, or any overlap of DATUM, of kind CODE is found
OpenPOWER on IntegriCloud