aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-11-26 14:32:34 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-11-26 14:32:34 -0500
commit320dd7a75afd6883535888aaa4baa88976d185e6 (patch)
tree29fadcb1bef11651421212193839f421d260313e
parent72d3b324bc6b5944947cae65a6ac0e96ab950729 (diff)
downloadgcc-320dd7a75afd6883535888aaa4baa88976d185e6.zip
gcc-320dd7a75afd6883535888aaa4baa88976d185e6.tar.gz
gcc-320dd7a75afd6883535888aaa4baa88976d185e6.tar.bz2
(nonzero_bits, case REG): Put POINTERS_EXTEND_UNSIGNED code before stack pointer code.
(nonzero_bits, case REG): Put POINTERS_EXTEND_UNSIGNED code before stack pointer code. Return nonzero at end of stack pointer code. From-SVN: r10600
-rw-r--r--gcc/combine.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 9d13e52..473adc8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6850,6 +6850,14 @@ nonzero_bits (x, mode)
switch (code)
{
case REG:
+#ifdef POINTERS_EXTEND_UNSIGNED
+ /* If pointers extend unsigned and this is a pointer in Pmode, say that
+ all the bits above ptr_mode are known to be zero. */
+ if (POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
+ && REGNO_POINTER_FLAG (REGNO (x)))
+ nonzero &= GET_MODE_MASK (ptr_mode);
+#endif
+
#ifdef STACK_BOUNDARY
/* If this is the stack pointer, we may know something about its
alignment. If PUSH_ROUNDING is defined, it is possible for the
@@ -6864,18 +6872,13 @@ nonzero_bits (x, mode)
sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment);
#endif
- nonzero &= ~ (sp_alignment - 1);
+ /* We must return here, otherwise we may get a worse result from
+ one of the choices below. There is nothing useful below as
+ far as the stack pointer is concerned. */
+ return nonzero &= ~ (sp_alignment - 1);
}
#endif
-#ifdef POINTERS_EXTEND_UNSIGNED
- /* If pointers extend unsigned and this is a pointer in Pmode, say that
- all the bits above ptr_mode are known to be zero. */
- if (POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
- && REGNO_POINTER_FLAG (REGNO (x)))
- nonzero &= GET_MODE_MASK (ptr_mode);
-#endif
-
/* If X is a register whose nonzero bits value is current, use it.
Otherwise, if X is a register whose value we can find, use that
value. Otherwise, use the previously-computed global nonzero bits