[LLVMbugs] [Bug 13918] New: __builtin_setjmp is not compatible with GCC

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 25 11:19:48 PDT 2012


             Bug #: 13918
           Summary: __builtin_setjmp is not compatible with GCC
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: stuart.rudderham at intel.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9256
  --> http://llvm.org/bugs/attachment.cgi?id=9256
Test case

The __builtin_setjmp function does different things on Clang compared to GCC.
On Clang only the stack pointer and frame pointer are saved, while GCC also
saves the resume address that is used to longjmp back.

A test case is attached, based on the below test from GCC

When compiled using GCC 4.6.3 (gcc __builtin_setjmp-test.c) the test program
returns 1, as expected.

When compiled using Clang 3.2 (clang __builtin_setjmp-test.c) the test program

Since the __builtin_setjmp function is supposed to be compatible with GCC, this
is a problem.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list