PATCH: PR rtl-optimization/49504: Invalid optimization for Pmode != ptr_mode

H.J. Lu
Fri Jun 24 13:55:00 GMT 2011

On Fri, Jun 24, 2011 at 1:58 AM, Eric Botcazou <> wrote:
>> I just don't see how nonzero_bits1 can assume if pointers extend unsigned
>> and this is an addition or subtraction to a pointer in Pmode, all the bits
>> bove ptr_mode are known to be zero.  We never run into it before x32
>> since x32 is the first such target.
> I agree that this is overly optimistical, but this was done on purpose:
> Could you evaluate the pessimization that the patch introduces (if any) for the
> generated code on x32?  If there is none or it is negligible, the patch is OK
> if completed by the removal of the equivalent code in num_sign_bit_copies1.
> If it isn't negligible, we may need to be clever and devise something else.

I compared x32 glibc built with the old x32 gcc against x32 glibc built with
this patch and

reverted, the new glibc is little smaller:


[hjl@gnu-33 build-x86_64-linux]$ size
   text	   data	    bss	    dec	    hex	filename
1537648	  10076	  12944	1560668	 17d05c
[hjl@gnu-33 build-x86_64-linux]$


[hjl@gnu-33 build-x86_64-linux.old]$ size
   text	   data	    bss	    dec	    hex	filename
1538968	  10076	  12944	1561988	 17d584
[hjl@gnu-33 build-x86_64-linux.old]$

I looked at assembly codes.  The new one is better.
I will check it in.



More information about the Gcc-patches mailing list