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

            Bug ID: 16688
           Summary: Inconsistent issue of the `ud2` instruction with
                    clang++ -O0
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

`clang++ -O0` will issue a `ud2` instruction at the bottom of `f` while other
combinations of optimization flags and options for `clang++/clang` do not.

a.c:
    int f() {}
    int main() { f(); }

╰─% clang++ -w a.c && ./a.out
[1]    20275 illegal hardware instruction (core dumped)  ./a.out
╭─ray @ lap >>= /tmp 
╰─[$: 132] % clang -w a.c && ./a.out                                            
╭─ray @ lap >>= /tmp 
╰─% clang++ -w -O1 a.c && ./a.out
[1]    20334 segmentation fault (core dumped)  ./a.out
╭─ray @ lap >>= /tmp 
╰─[$: 139] % clang -w -O1 a.c && ./a.out                                        
╭─ray @ lap >>= /tmp 
╰─% clang++ -w -O2 a.c && ./a.out
[1]    20395 segmentation fault (core dumped)  ./a.out
╭─ray @ lap >>= /tmp 
╰─[$: 139] % clang -w -O2 a.c && ./a.out

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