On 2/11/20 9:54 AM, 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.
Well, I guess I missed practically identical functions because I was in hurry to include the code (coloring for irregular register file architectures) before 2010 stage3 deadline.
        * 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?

Yes, thank you for fixing this.  The code is definitely more clear.


Reply via email to