http://llvm.org/bugs/show_bug.cgi?id=13918

             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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    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
http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gcc.c-torture/execute/built-in-setjmp.c?revision=184997&view=markup

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
segfaults.

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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to