[RFC][patch] trans-mem: mark transaction begins as returns-twice

Torvald Riegel triegel@redhat.com
Tue Jan 3 10:50:00 GMT 2012

On Tue, 2012-01-03 at 10:41 +0100, Richard Guenther wrote:
> On Tue, Jan 3, 2012 at 9:36 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> >> AFAICT, we previously wanted to handle "restart safety" by adding
> >> abnormal edges to all calls to the TM runtime library (which could in
> >> turn call the libitm longjmp that actually restarts a transaction).
> >> Richard mentioned that we could drop this code (I think he meant this,
> >> and others pieces perhaps) if the returns-twice approach works.
> >
> > Why does the explicit CFG approach not work exactly?  cfun->calls_setjmp is
> > thought to be quite a big hammer.
> Indeed.  And I wonder if it really works - given the restrictions on automatic
> variable use with these functions (IIRC you have to be careful and mark them
> all 'volatile').

Well, every variable that does get its address taken will have its
accesses re-routed through libitm, so those locations will be handled
properly using undo-logging and rollback by libitm.  For everything that
is only on the stack or in registers, it should work too because we
don't reuse the stack slots that cross the transaction begin, so we
always have those values available as a snapshot.
Also, the (non-working?) abnormal edges are still active in what I
tried, so perhaps there's some overlap there.

More information about the Gcc-patches mailing list