RFC/RFA: Fix bug with REE optimization corrupting extended registers
Thu Nov 19 15:34:00 GMT 2015
> I had a look around. There's code testing HARD_REGNO_NREGS in
> ree.c:combine_set_extension. It's inside #if 0, and labelled
> "temporarily disabled". See if enabling that helps you? (Jeff, that #if
> 0 was added by you).
I suspect that the code was disabled because it prevented too many
useful optimization opportunities.
The code there would solve this problem, but the approach is is overly
cautious, since it disables the optimization for all extensions that
increase the number of hard registers used. Some of these will be
viable candidates, provided that the extra hard registers are no used.
(This is certainly true for the RL78, where the (patched) optimization
does improve code, even though the widening does use extra registers).
More information about the Gcc-patches