aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-04-03 18:11:26 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-04-03 18:11:26 -0400
commitff0dbdd176ddd2bd1f40030e7adedb4d7e090fc1 (patch)
treef3015f7d18e826579a97aaf90d7b23790c3cdd18 /gcc
parent96ec484f7a846bd57b6fa5a5c230b863f9a5aeb3 (diff)
downloadgcc-ff0dbdd176ddd2bd1f40030e7adedb4d7e090fc1.zip
gcc-ff0dbdd176ddd2bd1f40030e7adedb4d7e090fc1.tar.gz
gcc-ff0dbdd176ddd2bd1f40030e7adedb4d7e090fc1.tar.bz2
(nonzero_bits, case REG): Check POINTERS_EXTEND_UNSIGNED.
(num_sign_bit_copies, case REG): Likewise. From-SVN: r9303
Diffstat (limited to 'gcc')
-rw-r--r--gcc/combine.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b25191e..05ec5d3 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -6752,10 +6752,18 @@ nonzero_bits (x, mode)
sp_alignment = MIN (PUSH_ROUNDING (1), sp_alignment);
#endif
- return nonzero & ~ (sp_alignment - 1);
+ 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
@@ -7091,6 +7099,14 @@ num_sign_bit_copies (x, mode)
{
case REG:
+#ifdef POINTERS_EXTEND_UNSIGNED
+ /* If pointers extend signed and this is a pointer in Pmode, say that
+ all the bits above ptr_mode are known to be sign bit copies. */
+ if (! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode && mode == Pmode
+ && REGNO_POINTER_FLAG (REGNO (x)))
+ return GET_MODE_BITSIZE (Pmode) - GET_MODE_BITSIZE (ptr_mode) + 1;
+#endif
+
if (reg_last_set_value[REGNO (x)] != 0
&& reg_last_set_mode[REGNO (x)] == mode
&& (reg_n_sets[REGNO (x)] == 1