-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 9733 |
| Resolution | DUPLICATE |
| Resolved on | Apr 15, 2011 12:18 |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
clang (latest svn trunk)
built with
x86_64-w64-mingw32-gcc version 4.5.3 20110414
configured by
CC='gcc -m32' CXX='g++ -m32' ../llvm-svn/configure --enable-optimized --disable-assertions --disable-docs --enable-shared
when compiling the following code
#include <stdio.h>
void stuff()
{
printf("Hello%s\n", " ");
}
clang -S -m32/-m64 generates the right assembly code, but
clang -S -O2 -m32/-m64 generates wrong code like this:
.def _vsnprintf;
.scl 2;
.type 32;
.endef
.text
.globl _vsnprintf
.align 16, 0x90
_vsnprintf:
jmpl *__imp___vsnprintf # TAILCALL
.def _vsnwprintf;
.scl 2;
.type 32;
.endef
.globl _vsnwprintf
.align 16, 0x90
_vsnwprintf:
jmpl *__imp___vsnwprintf # TAILCALL
.def _stuff;
.scl 2;
.type 32;
.endef
.globl _stuff
.align 16, 0x90
stuff:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $L.str1, 4(%esp)
movl $L_.str, (%esp)
calll _printf
addl $8, %esp
popl %ebp
ret
.data
L_.str:
.asciz "Hello%s\n"
L_.str1:
.asciz " "
symbols like _vsnprintf & _vsnwprintf should NOT be exported, they are in fact inlined functions
clang 2.9 release also has this problem.