llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.84k stars 11.47k forks source link

fast-isel cannot handle strlen #22651

Open llvmbot opened 9 years ago

llvmbot commented 9 years ago
Bugzilla Link 22277
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

~/llvmw/build/Deb~/llvmw/build/Debug+Asserts/bin/clang -O0 -mllvm -fast-isel-verbose -mllvm -fast-isel strlen1.c strlen1.c:12:3: warning: implicitly declaring library function 'printf' with type 'int (const char , ...)' printf("%i\n", len); ^ strlen1.c:12:3: note: include the header or explicitly provide a declaration for 'printf' FastISel missed call: %call = call i64 @​strlen(i8 %0) #​3 1 warning generated.

include

char *hello = "hello"; int len;

void foo() { len = strlen(hello); }

int main() { foo(); printf("%i\n", len); }

arsenm commented 1 year ago

clang -O0 -mllvm -fast-isel-abort=3 -mllvm -fast-isel fatal error: error in backend: FastISel missed call: %2 = call i64 @strlen(ptr noundef %1) #3, !dbg !13 (in function: foo)