combine.c (try_combine): When converting a paradoxical subreg to an extension...
authorJ"orn Rennecke <joern.rennecke@superh.com>
Thu, 11 Jul 2002 21:03:51 +0000 (21:03 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 11 Jul 2002 21:03:51 +0000 (22:03 +0100)
* combine.c (try_combine): When converting a paradoxical subreg
to an extension, take LOAD_EXTEND_OP into account.

From-SVN: r55404

gcc/ChangeLog
gcc/combine.c

index 34cbd0d..aece9e4 100644 (file)
@@ -1,3 +1,8 @@
+Thu Jul 11 22:02:57 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * combine.c (try_combine): When converting a paradoxical subreg
+       to an extension, take LOAD_EXTEND_OP into account.
+
 2002-07-11  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * config.gcc (mips-sgi-irix6*o32): New configuration.
index e7f2255..cd2e8df 100644 (file)
@@ -2283,8 +2283,19 @@ try_combine (i3, i2, i1, new_direct_jump_p)
          /* If *SPLIT is a paradoxical SUBREG, when we split it, it should
             be written as a ZERO_EXTEND.  */
          if (split_code == SUBREG && GET_CODE (SUBREG_REG (*split)) == MEM)
-           SUBST (*split, gen_rtx_ZERO_EXTEND  (split_mode,
-                                                SUBREG_REG (*split)));
+           {
+#ifdef LOAD_EXTEND_OP
+             /* Or as a SIGN_EXTEND if LOAD_EXTEND_OP says that that's
+                what it really is.  */
+             if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (*split)))
+                 == SIGN_EXTEND)
+               SUBST (*split, gen_rtx_SIGN_EXTEND (split_mode,
+                                                   SUBREG_REG (*split)));
+             else
+#endif
+               SUBST (*split, gen_rtx_ZERO_EXTEND (split_mode,
+                                                   SUBREG_REG (*split)));
+           }
 #endif
 
          newi2pat = gen_rtx_SET (VOIDmode, newdest, *split);