aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-01-22 15:50:06 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-01-22 15:50:06 -0500
commit0c314d1ab0636a2253dfc8b4f9f50010210556dc (patch)
tree777408b38b27ff8769acbfc3f77349fc573c111d
parentabb6b720734c1fb17251defde364f9b1e39ebcfb (diff)
downloadgcc-0c314d1ab0636a2253dfc8b4f9f50010210556dc.zip
gcc-0c314d1ab0636a2253dfc8b4f9f50010210556dc.tar.gz
gcc-0c314d1ab0636a2253dfc8b4f9f50010210556dc.tar.bz2
(num_sign_bit_copies): Ifndef WORD_REGISTER_OPERATIONS, ensure we
don't do the wrong thing if X is narrower than MODE. From-SVN: r6403
-rw-r--r--gcc/combine.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index a71b201..729d557 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1,5 +1,5 @@
/* Optimize by combining instructions for GNU compiler.
- Copyright (C) 1987, 1988, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -6965,6 +6965,14 @@ num_sign_bit_copies (x, mode)
return MAX (1, (num_sign_bit_copies (x, GET_MODE (x))
- (GET_MODE_BITSIZE (GET_MODE (x)) - bitwidth)));
+#ifndef WORD_REGISTER_OPERATIONS
+ /* If this machine does not do all register operations on the entire
+ register and MODE is wider than the mode of X, we can say nothing
+ at all about the high-order bits. */
+ if (GET_MODE (x) != VOIDmode && bitwidth > GET_MODE_BITSIZE (GET_MODE (x)))
+ return 1;
+#endif
+
switch (code)
{
case REG: