This is the mail archive of the
mailing list for the GCC project.
Re: Reload inheritance and auto inc/dec
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: Reload inheritance and auto inc/dec
- From: Bernd Schmidt <bernds at redhat dot co dot uk>
- Date: Thu, 14 Sep 2000 18:48:52 +0100 (BST)
- cc: law at cygnus dot com, gcc-patches at gcc dot gnu dot org
On 14 Sep 2000, Alexandre Oliva wrote:
> On Sep 14, 2000, Jeffrey A Law <firstname.lastname@example.org> wrote:
> > The scope of a REG_EQUIV note is the entire function.
> Ok, but since the pseudo only exists during a short interval, and
> reg:SI doesn't change in that interval, any occurrence of the pseudo
> can be safely replaced by the REG_EQUIV rtx. Wouldn't this be a valid
> use of REG_EQUIV?
I think so.
> Anyway, this is totally unrelated with the problem at hand. The
> actual problem shows up before that insn is considered.
> Unfortunately, I can't create a testcase that fails reliably; minor
> perturbations in other optimization passes can change the RTL at the
> beginning of reload in such a way that the bug hides away :-(
> But I've got a patch that addresses the actual problem: we failed to
> update reg_last_reload_reg when generating the reloads for the pseudo
> referenced by the auto_inc mem. That was the reason why the wrong
> register was chosen for inheritance afterwards. And here's a patch
> that fixes this problem. Unlike the previous patch, this one doesn't
> introduce regressions in a sh-elf testsuite run. Ok to install?
I believe this is almost right. However, you want this instead:
- = push_reload (x, x, loc, loc,
+ = push_reload (x, x, &XEXP (x_orig, 0), &XEXP (x_orig, 0),
and the comment is maybe a bit misleading.