(stupid_mark_refs): Handle SUBREG of pseudo-reg in a SET_DEST same as
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 29 Oct 1995 12:45:32 +0000 (07:45 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 29 Oct 1995 12:45:32 +0000 (07:45 -0500)
we handle a pseudo-reg in a SET_DEST.

From-SVN: r10541

gcc/stupid.c

index fb50b92a5ae4549ab30c93ebc4345cf9d8b77bfc..ed1afcf7dbeae19c7c98c1fba7b4e5ca77b064fc 100644 (file)
@@ -1,5 +1,5 @@
 /* Dummy data flow analysis for GNU compiler in nonoptimizing mode.
-   Copyright (C) 1987, 1991, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1991, 1994, 1995 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -423,10 +423,19 @@ stupid_mark_refs (x, insn)
 
   if (code == SET || code == CLOBBER)
     {
-      if (SET_DEST (x) != 0 && GET_CODE (SET_DEST (x)) == REG)
+      if (SET_DEST (x) != 0
+         && (GET_CODE (SET_DEST (x)) == REG
+             || (GET_CODE (SET_DEST (x)) == SUBREG
+                 && GET_CODE (SUBREG_REG (SET_DEST (x))) == REG
+                 && (REGNO (SUBREG_REG (SET_DEST (x)))
+                     >= FIRST_PSEUDO_REGISTER))))
        {
          /* Register is being assigned.  */
-         regno = REGNO (SET_DEST (x));
+         /* If setting a SUBREG, we treat the entire reg as being set.  */
+         if (GET_CODE (SET_DEST (x)) == SUBREG)
+           regno = REGNO (SUBREG_REG (SET_DEST (x)));
+         else
+           regno = REGNO (SET_DEST (x));
 
          /* For hard regs, update the where-live info.  */
          if (regno < FIRST_PSEUDO_REGISTER)