public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Bug in simplify_subreg?
@ 2002-08-02  4:02 Lars Brinkhoff
  2002-08-02 16:56 ` Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Brinkhoff @ 2002-08-02  4:02 UTC (permalink / raw)
  To: gcc

In simplify-rtx.c:simplify_subreg, there is some code to simplify a
SUBREG of a hard register (starting around line 2557).  This code is
careful not to make the simplification if the register is the stack,
frame, or argument pointer.  However, if the (inner)mode is larger
than SImode, no check is made to ensure that the simplification isn't
made such that the result is one of the above pointers.

I have a situation where the second word of a DI register is allocated
to the frame pointer register (the function doesn't need a frame
pointer).  In this case, the ORIGINAL_REGNO of the frame_pointer_rtx
will be clobbered with the old pseudo REGNO (around line 2597), which
later will be referenced, causing a crash.

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?  If so, I'll test and submit a patch.

-- 
Lars Brinkhoff          http://lars.nocrew.org/     Linux, GCC, PDP-10,
Brinkhoff Consulting    http://www.brinkhoff.se/    HTTP programming

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-08-07  5:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-02  4:02 Bug in simplify_subreg? Lars Brinkhoff
2002-08-02 16:56 ` Richard Henderson
2002-08-05  4:22   ` Lars Brinkhoff
2002-08-05  5:29     ` Richard Earnshaw
2002-08-05  5:43       ` Lars Brinkhoff
2002-08-06 19:09         ` Richard Henderson
2002-08-07  5:15           ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).