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


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.

Ian


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