This is the mail archive of the gcc-patches@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: unwind info for epilogues


Richard Henderson <rth@redhat.com> writes:

> Since the beginning, -fasynchronous-unwind-tables has not held correct
> information for function epilogues.  This is an attempt at adding
> that.
>
> In developing this patch, I tried several different approaches before
> settling on this.  In particular, a code interpretation scheme such as
> we use for prologues defeated me.  So in the end I've added enough REG
> notes to let the port maintainer to effectively control the dwarf2
> output directly.  Frankly, I'm considering converting the prologue to
> use the same notes and scrapping the existing interpretation code,
> which is extraordinarily complex.  And incorrect in the middle of the
> prologue for the stack realignment case (the state at the end of the
> prologue is correct, but one intermediate state isn't).
>
> Since this does require changes from port maintainers to their
> epilogue generation code, this currently only has any effect for x86,
> but should not actively fail for other targets.  Although I'd
> appreaciate folks checking that, since I do fiddle around with
> NOTE_INSN_EPILOGUE_BEG.

This approach seems clearly superior.  I wonder if you can provide some
simple functions for the backends to call to add notes and such.  One
could also imagine a more complex function which simply walked the
prologue and did something like what the current dwarf2out.c code does,
except adding reg notes.  That might make it relatively easy to
transition the backends to the new scheme.

Ian


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