On 1/7/19 7:42 AM, Andre Vieira (lists) wrote: > Hi, > > This patch fixes the way 'uses_hard_regs_p' handles paradoxical subregs. > The function is supposed to detect whether a register access of 'x' > overlaps with 'set'. For SUBREGs it should check whether any of the > full multi-register overlaps with 'set'. The former behavior used to > grab the widest mode of the inner/outer registers of a SUBREG and the > inner register, and check all registers from the inner-register onwards > for the given width. For normal SUBREGS this gives you the full > register, for paradoxical SUBREGS however it may give you the wrong set > of registers if the index is not the first of the multi-register set. > > The original error reported in PR target/86487 can no longer be > reproduced with the given test, this was due to an unrelated code-gen > change, regardless I believe this should still be fixed as it is simply > wrong behavior by uses_hard_regs_p which may be triggered by a different > test-case or by future changes to the compiler. Also it is useful to > point out that this isn't actually a 'target' issue as this code could > potentially hit any other target using paradoxical SUBREGS. Should I > change the Bugzilla ticket to reflect this is actually a target agnostic > issue in RTL? > > There is a gotcha here, I don't know what would happen if you hit the > cases of get_hard_regno where it would return -1, quoting the comment > above that function "If X is not a register or a subreg of a register, > return -1." though I think if we are hitting this then things must have > gone wrong before? > > Bootstrapped on aarch64, arm and x86, no regressions. > > Is this OK for trunk? > > > gcc/ChangeLog: > 2019-01-07 Andre Vieira <andre.simoesdiasvie...@arm.com> > > > PR target/86487 > * lra-constraints.c(uses_hard_regs_p): Fix handling of > paradoxical SUBREGS. But doesn't wider_subreg_mode give us the wider of the two modes here and we use that wider mode when we call overlaps_hard_reg_set_p which should ultimately check all the registers in the paradoxical.
I must be missing something here?!? jeff