[Bug other/59039] New: Undocumented __builtin_longjmp/__builtin_setjmp

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 7 12:51:00 GMT 2013


            Bug ID: 59039
           Summary: Undocumented __builtin_longjmp/__builtin_setjmp
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com

cilk_fiber-unix.cpp has

#pragma GCC push_options
#pragma GCC optimize ("-O0")
NORETURN cilk_fiber_sysdep::run()

It fails when compiled with any optimization.  This function has
__builtin_setjmp and __builtin_longjmp within the same function.
When __builtin_longjmp is put in a separate function, optimization
works.  But there is no documentation on how __builtin_longjmp
and __builtin_setjmp should be used, like the jump buffer size
and fields as well as any limitation.

If it is true that __builtin_setjmp and __builtin_longjmp can't be
used within the same function, GCC should issue an error, at least
a warning.

More information about the Gcc-bugs mailing list