diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-06 12:39:15 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-02-06 12:39:15 +0000 |
commit | bc17f7a49bf238d7a6fb3c07e70f221afd14f27c (patch) | |
tree | ef948bedc788321fdca09d6b2f508f386ee213d9 /gcc/simplify-rtx.c | |
parent | 73a7dbdd334650e4c456b3871bf6be04eb2f35c8 (diff) | |
download | gcc-bc17f7a49bf238d7a6fb3c07e70f221afd14f27c.tar.gz |
* combine.c (nonzero_bits, case PLUS): If pointers extend unsigned
and this is the sum of a pointer and a constant, we know the result
did not overflow.
(num_sign_bit_copies, case PLUS): Likewise.
* explow.c (convert_memory_address): Remove opposite SUBREG.
* function.c (instantiate_new_reg): New function (from common code).
(instantiate_virtual_regs_1): Call it.
For PLUS, handle if (plus (subreg (virt-reg) (const_int))
if pointers sign- or zero-extend.
* simplify-rtx.c (simplify_unary_operation, case ZERO_EXTEND):
If pointers extend unsigned, use inside of SUBREG.
(simplify_unary_operation, case SIGN_EXTEND): Likewise, if sign extend.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39489 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 6ae44b237a0..afd8d264b62 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -623,7 +623,11 @@ simplify_unary_operation (code, mode, op, op_mode) #ifdef POINTERS_EXTEND_UNSIGNED if (! POINTERS_EXTEND_UNSIGNED && mode == Pmode && GET_MODE (op) == ptr_mode - && CONSTANT_P (op)) + && (CONSTANT_P (op) + || (GET_CODE (op) == SUBREG + && GET_CODE (SUBREG_REG (op)) == REG + && REG_POINTER (SUBREG_REG (op)) + && GET_MODE (SUBREG_REG (op)) == Pmode))) return convert_memory_address (Pmode, op); #endif break; @@ -632,7 +636,11 @@ simplify_unary_operation (code, mode, op, op_mode) case ZERO_EXTEND: if (POINTERS_EXTEND_UNSIGNED && mode == Pmode && GET_MODE (op) == ptr_mode - && CONSTANT_P (op)) + && (CONSTANT_P (op) + || (GET_CODE (op) == SUBREG + && GET_CODE (SUBREG_REG (op)) == REG + && REG_POINTER (SUBREG_REG (op)) + && GET_MODE (SUBREG_REG (op)) == Pmode))) return convert_memory_address (Pmode, op); break; #endif |