This is the mail archive of the
mailing list for the GCC project.
Re: Bug in simplify_subreg?
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Lars Brinkhoff <lars dot spam at nocrew dot org>
- Cc: Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Mon, 05 Aug 2002 13:27:29 +0100
- Subject: Re: Bug in simplify_subreg?
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> Richard Henderson <firstname.lastname@example.org> writes:
> > On Fri, Aug 02, 2002 at 01:02:26PM +0200, Lars Brinkhoff wrote:
> > > If I insert the same checks against final_regno as are made to
> > > REGNO (op), everything seems to be fine. Is this the right thing
> > > to do?
> > No. If the frame pointer isn't being used, then gen_reg_RTX isn't
> > supposed to return frame_pointer_rtx.
> But it does. Since outermode==SImode==Pmode and reload_in_progress==0,
> gen_reg_RTX returns frame_pointer_rtx to simplify_subreg. And so
> ORIGINAL_REGNO of frame_pointer_rtx is clobbered.
> Would the right solution be to check frame_pointer_needed in gen_reg_RTX?
We cannot know for certain whether a frame pointer is needed before reload
starts. Even during reload the decision might change -- on some machines
the decision may depend on which registers are being used by the function
-- and that can change as we push more reloads.
It's probable that on many machines we can accurately guess whether a
frame pointer is needed or not before reload starts to run, but there's no
way to be sure.