On Tue, 2020-02-11 at 15:54 +0100, Hans-Peter Nilsson wrote:
> I was using ira-conflicts.c:print_hard_reg_set with a local
> patch to gdbinit.in in a debug-session, and noticed the
> erroneous output. I see there's an almost identical function in
> ira-color.c and on top of that, there's another function by the
> same name and with similar semantics in sel-sched-dump.c, but
> the last one doesn't try to print ranges.
>
> I'm guessing the dump functions have been used with targets that
> have "impossible" registers at FIRST_PSEUDO_REGISTER - 1. CRIS
> happens to have the condition-code register at
> FIRST_PSEUDO_REGISTER - 1; not allocatable but appears a lot in
> (clobbered) register sets after decc0ration.
>
> Before, for a target with FIRST_PSEUDO_REGISTER 20, you'd get
> "19-18" for (1<<19). For (1<<18)|(1<<19), you'd get "18".
>
> The diff is unfortunately hairy, but I hope you agree the code
> is a bit clearer. I'm deliberately not consolidating the dump
> functions as IMHO that's too much a matter of taste.
>
> * ira-conflicts.c (print_hard_reg_set): Correct output for sets
> including FIRST_PSEUDO_REGISTER - 1.
> * ira-color.c (print_hard_reg_set): Ditto.
>
> Ok to commit?
Not strictly a regression fix, but it's just dumping routines. So OK
for the trunk.
jeff
>