subreg:HI of PSI hw reg issue

Aurelien Buhrig aurelien.buhrig.gcc@gmail.com
Thu Feb 16 16:47:00 GMT 2012


Hi,

My target has HI and PSI hardware registers. HI hwregs can hold PSI
values, and PSI registers (ex A0 reg) can hold HI values.

My target is big endian and my problem occurs when I split a movpsi when
gcc computes sub registers of PSI hw register. For example when using
simplify_gen_subreg:

- (subreg:HI (reg:PSI A0) 2) which is the least significant part returns
NULL_RTX
- (subreg:HI (reg:PSI A0) 0) which is the most significant part returns
(reg:HI A0).

This means gcc consider that the HI part of a PSI reg is located at the
MS part of the register which is wrong on my target.
Hence, the cprop_hardreg pass may replace some registers by wrong ones
when PSI registers are split.

Is it a wishable behavior and is there a way to make such a split work
for PSI moves, or should I manage such a split at assembly level,
preventing some further optimizations ?

Thanks,
Aurélien



More information about the Gcc-help mailing list