aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-14 01:20:21 +0000
committerRichard Stallman <rms@gnu.org>1992-10-14 01:20:21 +0000
commit2166571b8f1a95012072e563d4c112da24d11167 (patch)
treeefb1de420b0e0876089d543b34c3291a8623c6e0 /gcc
parent9f61f8addd5b084ab3cb6e56812d6f4c54a8b026 (diff)
downloadgcc-2166571b8f1a95012072e563d4c112da24d11167.zip
gcc-2166571b8f1a95012072e563d4c112da24d11167.tar.gz
gcc-2166571b8f1a95012072e563d4c112da24d11167.tar.bz2
(simplify_binary_operation): Insure that folded >> extends
the sign even if the host bootstrap compiler doesn't. From-SVN: r2446
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 89cd433..12255b0 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3964,6 +3964,12 @@ simplify_binary_operation (code, mode, op0, op1)
return 0;
val = arg0s >> arg1;
+
+ /* Bootstrap compiler may not have sign extended the right shift.
+ Manually extend the sign to insure bootstrap cc matches gcc. */
+ if (arg0s < 0 && arg1 > 0)
+ val |= ((HOST_WIDE_INT) -1) << (HOST_BITS_PER_WIDE_INT - arg1);
+
break;
case ROTATERT: