http://llvm.org/bugs/show_bug.cgi?id=20853
Bug ID: 20853
Summary: ARM: Negative offset support problem
Product: tools
Version: trunk
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: llc
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 12990
--> http://llvm.org/bugs/attachment.cgi?id=12990&action=edit
Test
ARM compiler can use negative offset (imm12) only for a frame access.
The following example (n.c) shows problem:
int sum(int *p)
{
return p[-4] + p[-2] + p[0] + p[2] + p[4];
}
clang --target=arm -mcpu=cortex-a9 -S -mfloat-abi=soft -O3 n.c
sum:
sub r1, r0, #16 <<< instead of using [r0, #-16] to load a p[-4]
sub r2, r0, #8 <<< instead of using [r0, #-8] to load a p[-2]
ldr r1, [r1]
ldr r2, [r2]
ldr r3, [r0, #8]
add r1, r2, r1
ldr r2, [r0]
ldr r0, [r0, #16]
add r1, r1, r2
add r1, r1, r3
add r0, r1, r0
bx lr
--
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