[PATCH] Don't truncate paradoxical subregs in store_bit_field_1

Jeff Law law@redhat.com
Wed Jul 1 06:25:00 GMT 2009


Adam Nemet wrote:
> My patch here:
>
>   http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00766.html
>
> was basically wrong.  We create a truncation of a paradoxical subreg,
> i.e. note the second insn from the link:
>
>   (set (reg:SI 193)
>        (truncate:SI (subreg:DI (reg:SI 193) 0)))
>
> With more aggressive optization of truncate (I am working on a patch to handle
> TRUNCATE in force_to_mode) the above is turned into a simple no-op copy, which
> I think is a valid optimization.
>   
I agree that turning the above into a nop-copy ought to be valid as 
(reg:SI 93) should already be auto-magically sign-extended thus making 
the (truncate:SI (subreg:DI)) a nop.

> 	Revert:
> 	2009-01-11  Adam Nemet  <anemet@caviumnetworks.com>
> 	* expmed.c (store_bit_field_1): Properly truncate the paradoxical
> 	subreg of op0 to the original op0.
>
> 	* expmed.c (store_bit_field_1): Use a temporary as the destination
> 	instead of a paradoxical subreg when we need to truncate the result.
>   
OK.

Jeff



More information about the Gcc-patches mailing list