[LLVMbugs] [Bug 3520] New: llvm-gcc never calls SimplifyLibCalls::doInitialization
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon Feb 9 12:10:02 PST 2009
http://llvm.org/bugs/show_bug.cgi?id=3520
Summary: llvm-gcc never calls SimplifyLibCalls::doInitialization
Product: tools
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: llvm-gcc
AssignedTo: unassignedbugs at nondot.org
ReportedBy: nlewycky at google.com
CC: llvmbugs at cs.uiuc.edu
Builtin functions aren't picking up their nocapture attributes:
$ cat x.c
extern int use(char*x) {
return strlen(x);
}
$ llvm-gcc -O2 x.c -S -o - -emit-llvm
x.c: In function ‘use’:
x.c:2: warning: incompatible implicit declaration of built-in function
‘strlen’
; ModuleID = 'x.c'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
define i32 @use(i8* %x) nounwind readonly {
entry:
%0 = tail call i64 @strlen(i8* %x) nounwind readonly ;
<i64> [#uses=1]
%1 = trunc i64 %0 to i32 ; <i32> [#uses=1]
ret i32 %1
}
declare i64 @strlen(i8*) nounwind readonly
because SimplifyLibCalls::doInitialization is never being called even though
runOnFunction is. By contrast if you run opt -simplifylibcalls, it works fine.
--
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