[llvm-bugs] [Bug 25945] New: [x64] Improper CFI used for function clobbering FLAGS register

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 25 20:23:15 PST 2015


            Bug ID: 25945
           Summary: [x64] Improper CFI used for function clobbering FLAGS
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

define i64 @test_intervening_call(i64* %foo, i64 %bar, i64 %baz) {
  %cx = cmpxchg i64* %foo, i64 %bar, i64 %baz seq_cst seq_cst
  %v = extractvalue { i64, i1 } %cx, 0
  %p = extractvalue { i64, i1 } %cx, 1
  call void asm sideeffect "", "~{cc},~{dirflag},~{fpsr},~{flags}"()
  br i1 %p, label %t, label %f

  ret i64 42

  ret i64 0

this results in:
test_intervening_call:                  # @test_intervening_call
.seh_proc test_intervening_call
# BB#0:
        movq    %rdx, %rax
        lock            cmpxchgq        %r8, (%rcx)
        pushfq          <---- uh, oh...
        popq    %rax
        pushq   %rax
        jne     .LBB0_2
# BB#1:                                 # %t
        movl    $42, %eax
.LBB0_2:                                # %f
        xorl    %eax, %eax

Notice how we are manipulating the stack pointer even though we don't have a
frame pointer.

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/20151226/74648ab2/attachment.html>

More information about the llvm-bugs mailing list