aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-12-27 15:23:44 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-12-27 15:23:44 -0500
commit91102d5aed65fc7ac6d307b8cc9f7e703e089b9c (patch)
tree4e0fdc16082025bcbc91eaca4f4490c68a2e2c2a
parentdc6d66b319dd54d881f549b97d6ac17fdaa1d249 (diff)
downloadgcc-91102d5aed65fc7ac6d307b8cc9f7e703e089b9c.zip
gcc-91102d5aed65fc7ac6d307b8cc9f7e703e089b9c.tar.gz
gcc-91102d5aed65fc7ac6d307b8cc9f7e703e089b9c.tar.bz2
(set_nonzero_bits_and_sign_copies): Handle reg even if only set once and in one basic block.
(set_nonzero_bits_and_sign_copies): Handle reg even if only set once and in one basic block. (nonzero_bits, case REG): Use REGNO_POINTER_ALIGN instead of explicit alignment of registers pointing into frame. From-SVN: r10870
-rw-r--r--gcc/combine.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d37fcb2..ee16355 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -701,10 +701,8 @@ setup_incoming_promotions ()
#endif
}
-/* Called via note_stores. If X is a pseudo that is used in more than
- one basic block, is narrower that HOST_BITS_PER_WIDE_INT, and is being
- set, record what bits are known zero. If we are clobbering X,
- ignore this "set" because the clobbered value won't be used.
+/* Called via note_stores. If X is a pseudo that is narrower than
+ HOST_BITS_PER_WIDE_INT and is being set, record what bits are known zero.
If we are setting only a portion of X and we can't figure out what
portion, assume all bits will be used since we don't know what will
@@ -723,8 +721,6 @@ set_nonzero_bits_and_sign_copies (x, set)
if (GET_CODE (x) == REG
&& REGNO (x) >= FIRST_PSEUDO_REGISTER
- && reg_n_sets[REGNO (x)] > 1
- && reg_basic_block[REGNO (x)] < 0
/* If this register is undefined at the start of the file, we can't
say what its contents were. */
&& ! (basic_block_live_at_start[0][REGNO (x) / REGSET_ELT_BITS]
@@ -6888,26 +6884,25 @@ nonzero_bits (x, mode)
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
+ /* We may know something about the alignment of this register.
+ But 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 (x == stack_pointer_rtx)
+ if (REGNO_POINTER_ALIGN (REGNO (x)) != 0)
{
- int sp_alignment = STACK_BOUNDARY / BITS_PER_UNIT;
+ int alignment = REGNO_POINTER_ALIGN (REGNO (x));
#ifdef PUSH_ROUNDING
- sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment);
+ if (REGNO (x) == STACK_POINTER_REGNUM)
+ alignment = MIN (PUSH_ROUNDING (1), 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 &= ~ (sp_alignment - 1);
+ return nonzero &= ~ (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