http://llvm.org/bugs/show_bug.cgi?id=4984
Summary: llc -O0: incorrect emission of negative offsets
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Backend: X86
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Compiling attached testcase results in these assembler warnings on x86-64
$ llc -O0 <foo.bc | as
{standard input}: Assembler messages:
{standard input}:23: Warning: 4294967294 shortened to 254
That looks wrong since rax+254 is not the same as rax-2.
The generated assembler looks like this (I marked line 23 with >>> <<<)
.text
.align 16
.globl foo
.type foo,@function
foo: # @foo
.LBB1_0: # %entry
pushq %rbx
movq %rdi, %rbx
movl $40, %esi
movq %rbx, %rdi
call strchr
movabsq $2, %rcx
addq %rbx, %rcx
cmpq %rax, %rcx
ja .LBB1_2
.LBB1_1: # %"<bb 3>"
>>>>> movb 4294967294(%rax), %al <<<<<<<<<<<<<<<<<<<<<<<<<
cmpb $33, %al
sete %al
movl $1, %ecx
testb %al, %al
movl $0, %eax
cmovne %ecx, %eax
popq %rbx
ret
.LBB1_2: # %"<bb 5>"
xorl %eax, %eax
popq %rbx
ret
.size foo, .-foo
.section .note.GNU-stack,"",@progbits
Without -O0, llc by default outputs this where as doesn't warn:
.text
.align 16
.globl foo
.type foo,@function
foo: # @foo
.LBB1_0: # %entry
pushq %rbx
movq %rdi, %rbx
movl $40, %esi
movq %rbx, %rdi
call strchr
addq $2, %rbx
cmpq %rax, %rbx
ja .LBB1_2
.LBB1_1: # %"<bb 3>"
cmpb $33, -2(%rax)
sete %al
movzbl %al, %eax
popq %rbx
ret
.LBB1_2: # %"<bb 5>"
xorl %eax, %eax
popq %rbx
ret
.size foo, .-foo
.section .note.GNU-stack,"",@progbits
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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