[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


           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
  ; ModuleID = 'x.c'
  target datalayout =
  target triple = "x86_64-unknown-linux-gnu"

  define i32 @use(i8* %x) nounwind readonly {
          %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