This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: peephole vs RTX_FRAME_RELATED_P


Ian Lance Taylor writes:
 > Andrew Haley <aph@redhat.com> writes:
 > 
 > > On i386 we replace (add sp -4) with (push reg).  This generates faster
 > > and smaller code.
 > > 
 > > However, we are not copying RTX_FRAME_RELATED_P from the old
 > > instructions to the new, and so we are not emitting unwind information
 > > for the stack pointer adjustment.  The breaks stack traces on gcj, and
 > > I suspect it breaks a bunch of stuff elsewhere too.
 > > 
 > > This very crude patch sets RTX_FRAME_RELATED_P on every one of the new
 > > instructions if any of the old instructions had RTX_FRAME_RELATED_P
 > > set.  It seems to do the trick, but I suspect there must be a more
 > > subtle way to do it.
 > > 
 > > Can anyone suggest a neater way to do this?
 > 
 > I don't have a suggestion for a neater way to do this, but I do want
 > to note that, in the general case, just copying RTX_FRAME_RELATED_P is
 > insufficient.  We also need to copy any REG_FRAME_RELATED_EXPR reg
 > notes.

Thanks for that.

Yes, I see.  gcc does seem to be able to get the information it needs
to generate the unwinder by looking at the pattern, but I can imagine
circumstances where that won't be appropriate.

The problem that is bugging me is if there is more than one
instruction in the repleacement sequence, which one do you copy the
REG_FRAME_RELATED_EXPR to?

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]