http://llvm.org/bugs/show_bug.cgi?id=21976
Bug ID: 21976
Summary: __builtin_return_address(0) returns junk with the
post-RA scheduler
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: PowerPC
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 13575
--> http://llvm.org/bugs/attachment.cgi?id=13575&action=edit
test case
With the attached test case I get:
$ llc -o - bra.ll
...
.L.f:
.cfi_startproc
# BB#0:
mflr 0
ld 3, 16(1)
std 0, 16(1)
ld 0, 16(1)
mtlr 0
blr
...
Note that the return value (register 3) is loaded from the stack *before*
register 0 (copied from the link register) is stored, so this code will return
a junk value.
A workaround is to disable the post-RA scheduler:
$ llc -o - bra.ll -post-RA-scheduler=false
...
.L.f:
.cfi_startproc
# BB#0:
mflr 0
std 0, 16(1)
ld 3, 16(1)
ld 0, 16(1)
mtlr 0
blr
...
So I guess the post-RA scheduler doesn't understand the dependency between the
store and the load from this stack slot.
This bug is causing the sanitizer test case print-stack-trace.cc to fail on my
PowerPC64 box.
--
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