This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reinit regs upon global reg variable (IRA regression)


On Thu, Mar 19, 2009 at 1:46 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> QEMU for x86 declares a global variable with register asm("%ebp"). ?GCC
> trunk will miscompile it, using %ebp for normal register allocation
> (rather than frame pointer; it compiles with -O2 -fomit-frame-pointer),
> which ends up clobbering the variable.
>
> There's a testcase at
> https://bugzilla.redhat.com/show_bug.cgi?id=490509
>
> compute_all_subb is one of the functions that displays the problem.
>
> 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 patch fixes it.
>
> Bootstrapped and regression tested on i686-linux-gnu and
> x86_64-linux-gnu. ?Ok to install?

This looks like papering over a different issue.  I see that globalize_reg
is only called from make_decl_rtl, we should call that when we process
globals from the varpool.  So how do we end up in IRA before all
the global regs have been globalized?

So, if at all, we should call init_regs () after expanding the varpool.

Do we have a smaller testcase?

Thanks,
Richard.

> Jakub, would you please check this in if it's approved; I'm leaving on a
> trip tomorrow morning, and I don't expect to have much
> Internet-connected computer time before Monday, at the earliest.
> Thanks,
>
>
>
>
> --
> 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
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]