This is the mail archive of the
mailing list for the GCC project.
Auto inlining with only -O2?
- From: "Kaz Kylheku" <kaz at zeugmasystems dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 29 Nov 2007 18:34:15 -0800
- Subject: Auto inlining with only -O2?
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