This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: reinit regs upon global reg variable (IRA regression)
On Mar 19, 2009, Richard Guenther <richard.guenther@gmail.com> wrote:
> On Thu, Mar 19, 2009 at 1:46 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=490509
>> Turns out the new register allocation is using outdated information:
>> available (rather than fixed) register information in each register
>> class is computed before compilation starts, but it wasn't updated when
>> new registers became global, and IRA needs this information to be
>> updated.
> This looks like papering over a different issue.
How so? Maybe the fix is sub-optimal, but I can't get from that to
papering over a different issue.
> I see that globalize_reg is only called from make_decl_rtl
Yup, that's where we realize the decl is bound to a specific global
register and mark it as such, which must in turn recompute register
classes before they're used by anything else.
> we should call that when we process globals from the varpool.
This might very well work. It would be fragile in other ways, though,
in that it would depend on the current unit-at-a-time compilation mode.
Unless recomputing these sets becomes a performance problem, recomputing
them as soon as we make changes to the base sets works just fine and is
far more robust.
> So how do we end up in IRA before all the global regs have been
> globalized?
We don't. But they have been globalized after we computed the initial
init_regs(), and we never recomputed it.
> Do we have a smaller testcase?
No, I didn't waste time trying to reduce it. The problem was obvious
enough upfront, and register allocation testcases are too fragile to be
useful.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer