https://bugs.llvm.org/show_bug.cgi?id=48533

            Bug ID: 48533
           Summary: builtin longjmp miscompiled when jmpbuf is
                    rbp-relative address
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: j...@mit.edu
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

Created attachment 24293
  --> https://bugs.llvm.org/attachment.cgi?id=24293&action=edit
bitcode that llc miscompiles

If the address argument to __builtin_longjmp is %rbp-relative the longjmp is
miscompiled.  If I compile the attached .ll file with the 10.0 llc the function
ends

        movq    -48(%rbp), %rbp
        movq    -40(%rbp), %rax # This load needs the original rbp
        movq    -32(%rbp), %rsp # This load needs the original rbp
        jmpq    *%rax

Note that the first instruction overwrites %rbp but the next two instructions
depend on the old value.  The branch goes to a random address with a random
%rsp.

The same bug is present in the version of llvm 11 included with FreeBSD-CURRENT
(13.0).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to