[llvm-bugs] [Bug 28339] New: -verify-machineinstrs fails for intrinsics + va_start

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 27 22:37:52 PDT 2016


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

            Bug ID: 28339
           Summary: -verify-machineinstrs fails for intrinsics + va_start
           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, matze at braunis.de,
                    qcolombet at apple.com
    Classification: Unclassified

consider:
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"

define i8* @test(i64 %a, i8* %b, ...)  {
entry:
  %bar   = alloca i8
  call void @llvm.va_start(i8* %bar)
  call void @llvm.eh.unwind.init()
  %foo   = alloca i32
  call void @llvm.eh.return.i64(i64 %a, i8* %b)
  unreachable
}

declare void @llvm.eh.return.i64(i64, i8*)
declare void @llvm.eh.unwind.init()

declare void @llvm.va_start(i8*)

run with:
llc t.ll -o - -verify-machineinstrs -O0 -print-after-all

we get:
# After Prologue/Epilogue Insertion & Frame Finalization
# Machine code for function test: Properties: <Post SSA, tracking liveness,
AllVRegsAllocated>

[...]

Function Live Ins: %RDI, %RSI, %RDX, %RCX, %R8, %R9, %AL, %XMM0, %XMM1, %XMM2,
%XMM3, %XMM4, %XMM5, %XMM6, %XMM7

BB#0: derived from LLVM BB %entry
    Live Ins: %RDI %RSI %RDX %RCX %R8 %R9 %AL %XMM0 %XMM1 %XMM2 %XMM3 %XMM4
%XMM5 %XMM6 %XMM7 %R15 %R14 %R13 %R12 %RBX %RAX %RBP
[...]
        PUSH64r %RAX<kill>, %RSP<imp-def>, %RSP<imp-use>; flags: FrameSetup
[...]
        TEST8rr %AL, %AL<kill>, %EFLAGS<imp-def>

[...]

*** Bad machine code: Using an undefined physical register ***
- function:    test
- basic block: BB#0 entry (0x542e358)
- instruction: TEST8rr
- operand 0:   %AL

*** Bad machine code: Using an undefined physical register ***
- function:    test
- basic block: BB#0 entry (0x542e358)
- instruction: TEST8rr
- operand 1:   %AL<kill>
LLVM ERROR: Found 2 machine code errors.

*** Bad machine code: Using an undefined physical register ***
- function:    test
- basic block: BB#0 entry (0x542e358)
- instruction: TEST8rr
- operand 0:   %AL

*** Bad machine code: Using an undefined physical register ***
- function:    test
- basic block: BB#0 entry (0x542e358)
- instruction: TEST8rr
- operand 1:   %AL<kill>
LLVM ERROR: Found 2 machine code errors.

-- 
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/20160628/ffc229e5/attachment.html>


More information about the llvm-bugs mailing list