http://llvm.org/bugs/show_bug.cgi?id=5234
Daniel Dunbar <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | --- Comment #4 from Daniel Dunbar <[email protected]> 2009-10-19 16:01:37 --- I'm not convinced. Based on the full description -fno-inline sounds much more appropriate: -- -fno-inline ... Normally this option is used to keep the compiler from expanding ***any*** (emphasis mine) functions inline. -- In addition, -fno-inline does seem to stop at least some inlining with gcc. I have no idea what gcc is actually doing, of course. -- ddun...@giles:size$ cat t.c static int f0() { return 1; } int f1() { return f0(); } ddun...@giles:size$ gcc -O3 -m32 -S -o - t.c .text .align 4,0x90 .globl _f1 _f1: pushl %ebp movl %esp, %ebp movl $1, %eax leave ret .subsections_via_symbols ddun...@giles:size$ gcc -fno-inline -O3 -m32 -S -o - t.c .text .align 4,0x90 _f0: pushl %ebp movl %esp, %ebp movl $1, %eax leave ret .align 4,0x90 .globl _f1 _f1: pushl %ebp movl %esp, %ebp leave jmp _f0 .subsections_via_symbols ddun...@giles:size$ -- I attached the real example (a clang file, on Darwin x86_64) that I was looking at when I noticed this. -fno-inline-functions doesn't look like the right flag at all. -- ddun...@giles:size$ gcc -arch x86_64 -O3 -S -o - orig.ii | wc -c 1260250 ddun...@giles:size$ gcc -fno-inline -arch x86_64 -O3 -S -o - orig.ii | wc -c 2360776 ddun...@giles:size$ gcc -fno-inline-functions -arch x86_64 -O3 -S -o - orig.ii | wc -c 1255753 ddun...@giles:size$ /Developer/usr/bin/llvm-gcc -arch x86_64 -O3 -S -o - orig.ii | wc -c 1228860 ddun...@giles:size$ /Developer/usr/bin/llvm-gcc -fno-inline -arch x86_64 -O3 -S -o - orig.ii | wc -c 1228860 ddun...@giles:size$ /Developer/usr/bin/llvm-gcc -fno-inline-functions -arch x86_64 -O3 -S -o - orig.ii | wc -c 2878334 -- llvm-gcc seems more like it has the behavior of -fno-inline and -fno-inline-functions reversed, at least from a user perspective. -- 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. _______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
