aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-01-20 18:23:10 -0800
committerJim Wilson <wilson@gcc.gnu.org>1995-01-20 18:23:10 -0800
commit2aec5b7a12f06b0ec4c5b7969ad5eb02c19ce3ff (patch)
tree08eba94211a6eecdf437496d9c454dc444a819c8 /gcc
parent3fc347fa0d8064c6c7558648af4a51d1d476f834 (diff)
downloadgcc-2aec5b7a12f06b0ec4c5b7969ad5eb02c19ce3ff.zip
gcc-2aec5b7a12f06b0ec4c5b7969ad5eb02c19ce3ff.tar.gz
gcc-2aec5b7a12f06b0ec4c5b7969ad5eb02c19ce3ff.tar.bz2
(num_sign_bit_copies): Can handle paradoxical subreg only
if LOAD_EXTEND_OP is defined to SIGN_EXTEND. From-SVN: r8787
Diffstat (limited to 'gcc')
-rw-r--r--gcc/combine.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d7248bf6..3a16a70 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -7139,15 +7139,23 @@ num_sign_bit_copies (x, mode)
}
#ifdef WORD_REGISTER_OPERATIONS
+#ifdef LOAD_EXTEND_OP
/* For paradoxical SUBREGs on machines where all register operations
affect the entire register, just look inside. Note that we are
passing MODE to the recursive call, so the number of sign bit copies
will remain relative to that mode, not the inner mode. */
- if (GET_MODE_SIZE (GET_MODE (x))
- > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ /* This works only if loads sign extend. Otherwise, if we get a
+ reload for the inner part, it may be loaded from the stack, and
+ then we lose all sign bit copies that existed before the store
+ to the stack. */
+
+ if ((GET_MODE_SIZE (GET_MODE (x))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
+ && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND)
return num_sign_bit_copies (SUBREG_REG (x), mode);
#endif
+#endif
break;
case SIGN_EXTRACT: