[LLVMbugs] [Bug 14143] New: Call incorrectly marked tail
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Oct 21 19:02:55 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=14143
Bug #: 14143
Summary: Call incorrectly marked tail
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: rafael.espindola at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Running "opt -S -tailcallelim" in
define void @a(i8* %a, i8* %b) nounwind uwtable {
entry:
%c = alloca [100 x i8], align 16
%0 = bitcast [100 x i8]* %c to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %0, i64 100, i32 1, i1
false)
ret void
}
produces
define void @a(i8* %a, i8* %b) nounwind uwtable {
entry:
%c = alloca [100 x i8], align 16
%0 = bitcast [100 x i8]* %c to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %a, i64 100, i32 1, i1
false)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %0, i64 100, i32 1, i1
false)
ret void
}
which I think is incorrect since "tail call" requires that "callee function
does not access any allocas or varargs in the caller.".
A consequence is that running "opt -S -no-aa -basicaa -dse" on the result
produces:
define void @a(i8* %a, i8* %b) nounwind uwtable {
entry:
%c = alloca [100 x i8], align 16
%0 = bitcast [100 x i8]* %c to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %0, i64 100, i32 1, i1
false)
ret void
}
--
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.
More information about the llvm-bugs
mailing list