• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: inlining
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inlining


  • Subject: Re: inlining
  • From: Steve Checkoway <email@hidden>
  • Date: Sun, 16 Dec 2007 12:30:09 -0800


On Dec 16, 2007, at 12:18 PM, David Rowland wrote:

I have never, with any version of Xcode, been able to make it inline the code I want. Even the simplest functions, like,

inline int ff() {return 55;}

produce out of line code with jump and return instructions. That is true for class member functions too. I have tried different optimization levels to no effect. I don't see any compiler options that seem to affect it. Anyone have an idea?


$ cat inline.c
static inline int a() { return 37; }
static __inline int b() { return 55; }
static __inline__ int c() { return 82; }
static __attribute__((always_inline)) int d() { return 78; }

int main()
{
	return a() + b() + c() + d();
}

$ gcc -Wall -O3 inline.c -S
$ cat inline.s
	.section __TEXT,__text,regular,pure_instructions
	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
	.machine ppc
	.text
	.align 2
	.p2align 4,,15
	.globl _main
_main:
	li r3,252
	blr
	.subsections_via_symbols

If I remove the static, it emits out of line copies (of course), but the code is still inlined.

--
Steve Checkoway

    "Anyone who says that the solution is to educate the users
    hasn't ever met an actual user." -- Bruce Schneier




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >inlining (From: David Rowland <email@hidden>)

  • Prev by Date: inlining
  • Next by Date: Re: inlining
  • Previous by thread: inlining
  • Next by thread: Re: inlining
  • Index(es):
    • Date
    • Thread