aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-04-17 15:32:22 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-04-17 15:32:22 -0400
commita4bde0b117fa3575f34d259e5b62e577fe64ce83 (patch)
tree5ca8bfff5defa9e837ebc9cbf7a1973392fdab0d /gcc
parentd0b97e0a2dc85fc16f79358c248720029f0526bc (diff)
downloadgcc-a4bde0b117fa3575f34d259e5b62e577fe64ce83.zip
gcc-a4bde0b117fa3575f34d259e5b62e577fe64ce83.tar.gz
gcc-a4bde0b117fa3575f34d259e5b62e577fe64ce83.tar.bz2
*** empty log message ***
From-SVN: r764
Diffstat (limited to 'gcc')
-rw-r--r--gcc/combine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index bee3287..247f66a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2583,10 +2583,13 @@ subst (x, from, to, in_dest, unique_copy)
}
/* For a constant, try to pick up the part we want. Handle a full
- word and low-order part. */
+ word and low-order part. Only do this if we are narrowing
+ the constant; if it is being widened, we have no idea what
+ the extra bits will have been set to. */
if (CONSTANT_P (SUBREG_REG (x)) && op0_mode != VOIDmode
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
+ && GET_MODE_SIZE (op0_mode) < UNITS_PER_WORD
&& GET_MODE_CLASS (mode) == MODE_INT)
{
temp = operand_subword (SUBREG_REG (x), SUBREG_WORD (x),
@@ -2595,7 +2598,8 @@ subst (x, from, to, in_dest, unique_copy)
return temp;
}
- if (CONSTANT_P (SUBREG_REG (x)) && subreg_lowpart_p (x))
+ if (CONSTANT_P (SUBREG_REG (x)) && subreg_lowpart_p (x)
+ && GET_MODE_SIZE (mode) < GET_MODE_SIZE (op0_mode))
return gen_lowpart_for_combine (mode, SUBREG_REG (x));
/* If we are narrowing the object, we need to see if we can simplify