Bug in simplify_subreg?
Richard Earnshaw
rearnsha@arm.com
Mon Aug 5 05:29:00 GMT 2002
> Richard Henderson <rth@redhat.com> 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.
R.
More information about the Gcc
mailing list