Auto inlining with only -O2?

Kaz Kylheku kaz@zeugmasystems.com
Fri Nov 30 03:18:00 GMT 2007


Hi all,

I'm using gcc-4.1.1 to compile glibc. In the nptl threads library, the
static function "allocate_stack" (in allocatestack.c which is #included
into pthread_create.c) is being integrated into "__pthread_create_2_1"
when pthread_create.c is compiled. In the build log, it's clear that the
optimization is -O2, and no -f... option is specified to request
inlining. Neither function has any special attributes. The object file
has no allocatestack symbol, and it's obvious that the code is in the
middle of pthread_create.

Does this kind of integration happen when a static function has but a
single caller, even if inlining isn't requested? If so, is this
documented somewhere?



More information about the Gcc-help mailing list