flow.c (life_analysis): Delete obvious no-op moves which use SUBREGs.
authorJeff Law <law@gcc.gnu.org>
Tue, 4 Feb 1997 23:36:26 +0000 (16:36 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 4 Feb 1997 23:36:26 +0000 (16:36 -0700)
        * flow.c (life_analysis): Delete obvious no-op moves
        which use SUBREGs.

From-SVN: r13607

gcc/flow.c

index 75948c562bdd664eda2b24d362aa1899ee2f0d76..72b42ead9b310070d0340fd8736eb8c2944ef7fc 100644 (file)
@@ -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,