[LLVMbugs] [Bug 19207] New: With -std=c++11, setjmp and sigsetjmp lose returns_twice attribute

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 20 05:54:01 PDT 2014


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

            Bug ID: 19207
           Summary: With -std=c++11, setjmp and sigsetjmp lose
                    returns_twice attribute
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This results in rare miscompilations and is causing the current failure on
lab.llvm.org:8011/builders/sanitizer-x86_64-linux (android tests). Observed
both on arm-android and x86_64-linux.

$ cat 1.cc
#include <setjmp.h>
void f() {
  jmp_buf a;
  sigjmp_buf b;
  setjmp(a);
  sigsetjmp(b, true);
}

# clang++ 1.cc -S -emit-llvm -o -
...
; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(%struct.__jmp_buf_tag*) #1

; Function Attrs: nounwind returns_twice
declare i32 @__sigsetjmp(%struct.__jmp_buf_tag*, i32) #1
...

# clang++ 1.cc -S -emit-llvm -std=c++11 -o -
...
; Function Attrs: nounwind
declare i32 @_setjmp(%struct.__jmp_buf_tag*) #1

; Function Attrs: nounwind
declare i32 @__sigsetjmp(%struct.__jmp_buf_tag*, i32) #1
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140320/42b39eab/attachment.html>


More information about the llvm-bugs mailing list