[LLVMbugs] [Bug 21743] New: register allocation error on win64 (atom?)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 3 21:51:50 PST 2014


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

            Bug ID: 21743
           Summary: register allocation error on win64 (atom?)
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: vtjnash at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13426
  --> http://llvm.org/bugs/attachment.cgi?id=13426&action=edit
win64 atom llvm code fragment

it seems that some lowering pass is unaware that the RCX register is already in
use when it uses it as temporary space. I'm not quite sure how to isolate the
code that is resulting in this error – some guidance would be appreciated. I've
attached the llvm code for the function that exhibits the issue. Specifically,
the win64 calling convention specifies that the first argument to the function
is passed in %RCX. This code appears to be expecting to pass that value right
through to the first function call (julia_ht_keyindex23309) by leaving it in
the %RCX register for the next function call. However, some code emission stage
appears to be thwarting this when it uses %RCX in a temporary computation (lea
rcx)


```
$ /opt/local/bin/llc-mp-3.5 -o - win64atom.ll -disable-fp-elim
-x86-asm-syntax=intel -mcpu=atom
    .text
    .file   "win64atom.ll"
    .globl  "julia_setindex!42311"
    .align  16, 0x90
    .type   "julia_setindex!42311", at function
"julia_setindex!42311":                 # @"julia_setindex!42311"
    .cfi_startproc
# BB#0:                                 # %L
    push    rbp
.Ltmp0:
    .cfi_def_cfa_offset 16
.Ltmp1:
    .cfi_offset rbp, -16
    mov rbp, rsp
.Ltmp2:
    .cfi_def_cfa_register rbp
    push    rsi
    push    rdi
    push    rbx
    lea rsp, qword ptr [rsp - 104]
.Ltmp3:
    .cfi_offset rbx, -40
.Ltmp4:
    .cfi_offset rdi, -32
.Ltmp5:
    .cfi_offset rsi, -24
    mov rax, qword ptr [rip + jl_pgcstack]
    mov rbx, r8
    mov rdi, rdx
    mov rsi, rcx
    lea rcx, qword ptr [rbp - 88]
    xorps   xmm0, xmm0
    mov rdx, rbx
    mov qword ptr [rbp - 88], 12
    mov qword ptr [rbp - 80], rax
    movups  xmmword ptr [rbp - 72], xmm0
    mov qword ptr [rip + jl_pgcstack], rcx
                                        # kill: RCX<def> RSI<kill>
    movups  xmmword ptr [rbp - 56], xmm0
    movups  xmmword ptr [rbp - 40], xmm0
    call    julia_ht_keyindex23309 at PLT
    ...
```

cross-ref: https://github.com/JuliaLang/julia/issues/9199

-- 
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/20141204/2dbce126/attachment.html>


More information about the llvm-bugs mailing list