combine.c (subst): Do not substitute for a register as a destination...
authorRichard Henderson <rth@redhat.com>
Tue, 22 May 2001 06:58:17 +0000 (23:58 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 22 May 2001 06:58:17 +0000 (23:58 -0700)
        * combine.c (subst): Do not substitute for a register as
        a destination subreg/strict_low_part/zero_extract.

From-SVN: r42429

gcc/ChangeLog
gcc/combine.c

index cd7336eafb17d3f1f0dd52e411bf9cfb5cee8bc5..5e578ae996e0bf7e3528b8b0b9ac88886156fe7c 100644 (file)
@@ -1,5 +1,8 @@
 2001-05-21  Richard Henderson  <rth@redhat.com>
 
+       * combine.c (subst): Do not substitute for a register as
+       a destination subreg/strict_low_part/zero_extract.
+
        * combine.c (simplify_comparison): Update op1 after constant
        extension.
        * recog.c (const_int_operand): Accept only constants valid
index e3ad70a960410366f2573715a508d406b06d0c80..675b1fe3e915ec07aea745ad06c633107cfec202 100644 (file)
@@ -3394,7 +3394,16 @@ subst (x, from, to, in_dest, unique_copy)
            }
          else if (fmt[i] == 'e')
            {
-             if (COMBINE_RTX_EQUAL_P (XEXP (x, i), from))
+             /* If this is a register being set, ignore it.  */
+             new = XEXP (x, i);
+             if (in_dest
+                 && (code == SUBREG || code == STRICT_LOW_PART
+                     || code == ZERO_EXTRACT)
+                 && i == 0
+                 && GET_CODE (new) == REG)
+               ;
+
+             else if (COMBINE_RTX_EQUAL_P (XEXP (x, i), from))
                {
                  /* In general, don't install a subreg involving two
                     modes not tieable.  It can worsen register