This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: peephole vs RTX_FRAME_RELATED_P
- From: Ian Lance Taylor <ian at airs dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: 19 Dec 2005 11:41:35 -0800
- Subject: Re: RFC: peephole vs RTX_FRAME_RELATED_P
- References: <17318.64145.41810.488474@zapata.pink>
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