OSDN Git Service

Properly handle pointer addition/subtraction in num_sign_bit_copies1.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jun 2011 15:26:33 +0000 (15:26 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jun 2011 15:26:33 +0000 (15:26 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175383 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/rtlanal.c

index 3034c64..f0c2f00 100644 (file)
@@ -2,7 +2,8 @@
 
        PR rtl-optimization/49504
        * rtlanal.c (nonzero_bits1): Properly handle addition or
-       subtraction a pointer in Pmode if pointers extend unsigned.
+       subtraction of a pointer in Pmode if pointers extend unsigned.
+       (num_sign_bit_copies1): Likewise.
 
 2011-06-24  Martin Jambor  <mjambor@suse.cz>
 
index e5c045d..0be6504 100644 (file)
@@ -4605,21 +4605,6 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
                                         known_x, known_mode, known_ret);
       result = MAX (1, MIN (num0, num1) - 1);
 
-#ifdef POINTERS_EXTEND_UNSIGNED
-      /* If pointers extend signed and this is an addition or subtraction
-        to a pointer in Pmode, all the bits above ptr_mode are known to be
-        sign bit copies.  */
-      /* As we do not know which address space the pointer is refering to,
-        we can do this only if the target does not support different pointer
-        or address modes depending on the address space.  */
-      if (target_default_pointer_address_modes_p ()
-         && ! POINTERS_EXTEND_UNSIGNED && GET_MODE (x) == Pmode
-         && (code == PLUS || code == MINUS)
-         && REG_P (XEXP (x, 0)) && REG_POINTER (XEXP (x, 0)))
-       result = MAX ((int) (GET_MODE_BITSIZE (Pmode)
-                            - GET_MODE_BITSIZE (ptr_mode) + 1),
-                     result);
-#endif
       return result;
 
     case MULT: