summaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-02-04 23:36:26 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1997-02-04 23:36:26 +0000
commitda8cdbc4e6cf6d91e166f309c612174a44f1be21 (patch)
tree44dce3a6399d68d0be62b88f643dfaf434e780f3 /gcc/flow.c
parentbfa1089d3d0c822449d6da40b619455914748c5b (diff)
downloadgcc-da8cdbc4e6cf6d91e166f309c612174a44f1be21.tar.gz
* flow.c (life_analysis): Delete obvious no-op moves
which use SUBREGs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13607 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 75948c562bd..72b42ead9b3 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -996,6 +996,23 @@ life_analysis (f, nregs)
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (insn) = 0;
}
+ /* Delete (in effect) any obvious no-op moves. */
+ else if (GET_CODE (PATTERN (insn)) == SET
+ && GET_CODE (SET_DEST (PATTERN (insn))) == SUBREG
+ && GET_CODE (SUBREG_REG (SET_DEST (PATTERN (insn)))) == REG
+ && GET_CODE (SET_SRC (PATTERN (insn))) == SUBREG
+ && GET_CODE (SUBREG_REG (SET_SRC (PATTERN (insn)))) == REG
+ && REGNO (SUBREG_REG (SET_DEST (PATTERN (insn)))) ==
+ REGNO (SUBREG_REG (SET_SRC (PATTERN (insn))))
+ && SUBREG_WORD (SET_DEST (PATTERN (insn))) ==
+ SUBREG_WORD (SET_SRC (PATTERN (insn)))
+ /* Insns carrying these notes are useful later on. */
+ && ! find_reg_note (insn, REG_EQUAL, NULL_RTX))
+ {
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ }
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
{
/* If nothing but SETs of registers to themselves,