https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85620
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- getcontext does return twice. Swapcontext only returns once. If you get the current context, and then latter on swap the context, you just returned to the place where getcontext is called. you do setcontext (or swapcontext again), you get the swapcontext context. That is it only ever returns once.