Re: How to disable gcc automatic inlining ?
Re: How to disable gcc automatic inlining ?
- Subject: Re: How to disable gcc automatic inlining ?
- From: Steve Checkoway <email@hidden>
- Date: Tue, 11 Nov 2008 09:54:07 -0800
On Nov 11, 2008, at 9:01 AM, Paul Russell wrote:
Thanks - that looks like it ought to work but it doesn't seem to
have any effect, at least with Apple's gcc 4.0.1. It would appear
that -O3 implies -finline-functions and adding -fno-inline-functions
(either before or after the -O3) does not make any difference. I
guess it's a bug.
It would seem that nonstatic, noninline functions are not inlined.
Those marked static or inline are potentially inlined.
[PBG4:~/temp] steve$ cat b.c
int a() { return 1; }
int call_a() { return a(); }
inline int b() { return 2; }
int call_b() { return b(); }
static int c() { return 3; }
int call_c() { return c(); }
static inline int d() { return 4; }
int call_d() { return d(); }
[PBG4:~/temp] steve$ gcc -Wall -S -O3 -fno-inline-functions b.c
[PBG4:~/temp] steve$ cat b.s
.section __TEXT,__text,regular,pure_instructions
.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
.machine ppc7400
.text
.align 2
.p2align 4,,15
.globl _a
_a:
li r3,1
blr
.align 2
.p2align 4,,15
.globl _call_a
_call_a:
b _a
.align 2
.p2align 4,,15
.globl _b
_b:
li r3,2
blr
.align 2
.p2align 4,,15
.globl _call_c
_call_c:
li r3,3
blr
.align 2
.p2align 4,,15
.globl _call_d
_call_d:
li r3,4
blr
.align 2
.p2align 4,,15
.globl _call_b
_call_b:
li r3,2
blr
.subsections_via_symbols
Note that a() is the only call not inlined.
Any other suggestions gratefully received.
Look through the man page and enable each optimization you want
individually.
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden