Hi, It seems there is an issue around subreg:HI of PSI hardware register, which occurs either during expand or reload (GCC 4.6.1).
For my big endian target, (subreg:HI (reg:PSI A0_REGNO) 0) is not representable but (subreg:HI (reg:PSI A0_REGNO) 2) is (reg:HI A0_REGNO). The issue occurs when storing a pointer from hardware PSI register (incoming pointer param) into a misaligned field of a packed structure. GCC emits (subreg:HI (reg:PSI A0_REGNO) 0) and (subreg:HI (reg:PSI A0_REGNO) 2) patterns and during reload, (subreg:HI (reg:PSI A0_REGNO) 0) is wrongly simplified into (reg:HI A0_REGNO). So: - Is it correct that gcc emits such a subreg pattern in Pmode=PSI during expand ? Or should it be in ptr_mode=SImode (in this case, both (subreg:HI (reg:SI) 0/2) are representable)? - Or should reload be able to handle unrepresentable subregs? Thank you by advance, Aurélien