This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH 2: Re: BOOTSTRAP FAILURE: segementation fault in genattrtab under hpux
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: PATCH 2: Re: BOOTSTRAP FAILURE: segementation fault in genattrtab under hpux
- From: law at redhat dot com
- Date: Mon, 20 Nov 2000 21:39:38 -0700
- cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Reply-To: law at redhat dot com
In message <200011181947.OAA10177@hiauly1.hia.nrc.ca>you write:
> > > The problem is the base and index registers in the ldb instruction
> > > have been interchanged by rename registers. These are not interchang
> eable
> > > on the pa because the space register for the instruction is loaded fr
> om
> > > the base register. Richard and Jeff, any thoughts on how to fix this
> > > one?
>
> ...
>
> > pa.c::basereg_operand
> > /* Once reload has started everything is considered valid. Reload shoul
> d
> > only create indexed addresses using the stack/frame pointer, and any
> > others were checked for validity when created by the combine pass.
> >
> > Also allow any register when TARGET_NO_SPACE_REGS is in effect since
> > we don't have to worry about the braindamaged implicit space registe
> r
> > selection using the basereg only (rather than effective address)
> > screwing us over. */
> > if (TARGET_NO_SPACE_REGS || reload_in_progress || reload_completed)
> > return (GET_CODE (op) == REG);
> >
> >
> > I believe the easiest/best fix is to move REGNO_POINTER_FLAG into the REG
> > expression itself, then arrange for basereg_operand to check that flag.
> >
> > THat would also allow us to clean up other warts in the PA backend.
>
> The enclosed patch fixes the above problem and removes the related warts
> in the PA backend. It also includes the return clean up by Richard
> Henderson. Tested with a complete bootstrap and check.
>
> Please review for installation.
I see two independent patches here. You need to separate them.
I don't see how your patch to basereg_operand can work.
Consider what happens when you have two pseudos X & Y where one of them is
a pointer and one of them is not a pointer and they get assigned to the same
hard register.
REGNO_POINTER_FLAG (REGNO (X)) == REGNO_POINTER_FLAG (REGNO (Y)) because
we'd be looking at the pointer flag for the hard register (once reload had
completed).
That won't work (I tried it a few years ago).
To make this work you want the bit indicating if a register is a pointer to
be put in the REG rtx itself. That way you can just do something like
REG_POINTER (X) and REG_POINTER (Y).
Note that by putting it in the REG itself, you can distinguish the case
when two pseudos are assigned the same hard reg, but only one of them is
a real pointer. Why? Look at how we update the REG expression when we
convert from a pseudo reg to a hard reg -- all we do is change REGNO (X)
and REGNO (Y) -- we don't change anything else in the underlying
REG expression.
I didn't look at the return insn changes -- they need to be separated out from
this patch anyway.
jeff