PATCH: PR rtl-optimization/50696: [x32] Unnecessary lea

H.J. Lu
Thu Oct 13 22:22:00 GMT 2011

On Thu, Oct 13, 2011 at 2:30 PM, Richard Kenner
<> wrote:
>> It is because mask 0xffffffff is optimized to 0xfffffffc by keeping track
>> of non-zero bits in registers and the above code doesn't take that
>> into account.
> Then I'd suggest modifying that code so that it does rather than
> essentially duplicating it.  But I'd recommend running some
> performance tests to verify that you're not pessimizing things when
> you do that: this stuff can be very tricky and you want to make sure
> that you're not converting something like (and X 3) into a bit
> extraction unnecessarily.

But the current code converts (and X 3) into a bit extraction
since ((i = exact_log2 (UINTVAL (XEXP (x, 1)) + 1)) >= 0) is true
when UINTVAL (XEXP (x, 1))  == 3.  Should we do it or not?


More information about the Gcc-patches mailing list