aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-01-30 06:48:12 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1996-01-30 06:48:12 -0500
commitb0d71df9409c7c7449b2969ce48f93061a6638c1 (patch)
treee3ed4114e4ccc105c0ca9a2eda93e2f61932ed1d /gcc
parent3f83ac49044ab7a3ac8420c4294edae820c9577e (diff)
downloadgcc-b0d71df9409c7c7449b2969ce48f93061a6638c1.zip
gcc-b0d71df9409c7c7449b2969ce48f93061a6638c1.tar.gz
gcc-b0d71df9409c7c7449b2969ce48f93061a6638c1.tar.bz2
(nonzero_bits, case REG): Ignore REG_POINTER_ALIGNMENT.
Restore old code for SP, but use it for all pointers to defined locations in the frame. From-SVN: r11123
Diffstat (limited to 'gcc')
-rw-r--r--gcc/combine.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index efcdea3..3e91601 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6921,25 +6921,30 @@ nonzero_bits (x, mode)
nonzero &= GET_MODE_MASK (ptr_mode);
#endif
- /* We may know something about the alignment of this register.
- But if PUSH_ROUNDING is defined, it is possible for the
+#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
stack to be momentarily aligned only to that amount, so we pick
the least alignment. */
- if (REGNO_POINTER_ALIGN (REGNO (x)) != 0)
+ if (x == stack_pointer_rtx || x == frame_pointer_rtx
+ || x == arg_pointer_rtx || x == hard_frame_pointer_rtx
+ || (REGNO (x) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (x) <= LAST_VIRTUAL_REGISTER))
{
- int alignment = REGNO_POINTER_ALIGN (REGNO (x));
+ int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT;
#ifdef PUSH_ROUNDING
if (REGNO (x) == STACK_POINTER_REGNUM)
- alignment = MIN (PUSH_ROUNDING (1), alignment);
+ sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment);
#endif
/* 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 &= ~ (alignment - 1);
+ return nonzero &= ~ (sp_alignment - 1);
}
+#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