This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: init_reg_autoinc bug and how to describe regs that can't autoincdec
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Cc: hans-peter dot nilsson at axis dot com, gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 Nov 2007 22:11:38 +0100
- Subject: Re: init_reg_autoinc bug and how to describe regs that can't autoincdec
> From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
> Date: Wed, 21 Nov 2007 15:36:51 EST
> > So, the main question is, how should this code change to also work for
> > a register class that can't be used for autoincdeced but doesn't need
> > secondary reloads at all?
>
> I don't think it needs to.
Why not? Nothing else does it.
> This is 13 years old, but my recollection is
> that we wanted to avoid the need for secondary reloads on autoincs,
> either because of efficiency or because, at that time at least, reload
> didn't have the code to do it.
>
> But if there *is* no secondary reload, then what's the problem with putting
> a pseudo into an arbitrary register?
I don't understand what you mean; there's a misunderstanding
here. To be very brief, I can't have (post_inc (reg:SI 15)) and
a gdb session tells me this code is responsible for making sure
that's a valid allocation.
I shouldn't need to fake a need for secondary reloads for this
register, when the register by itself can be moved anywhere with
a single instruction; I should only need to tell that the
post_inc operation is not valid. You're not supposed to do that
by TARGET_SECONDARY_RELOAD, AFAICT. I have described this
noninc target detail by means of GO_IF_LEGITIMATE_ADDRESS,
MODE_CODE_BASE_REG_CLASS and REGNO_MODE_CODE_OK_FOR_BASE_P and
the constraints don't match memory operands with the invalid
operation.
> Reload can generate the appropriate
> moves to make it work.
Nope, it doesn't. The forbidden_inc_dec_class info is what
guides global allocation validity here.
Am I missing something obvious?
brgds, H-P