smart gcc inliner...
Hi,
The recent gcc (3.4/4.x) optimizer inlines functions across sections which is definitely not we want, e.g. inlining functions from .init.text section.
I think, the __init' macro needs noinline' attribute and all the static inline __{dev}init' functions need inline' attribute removal to avoid gcc error (inlining failed, function not inlinable).
Full discussion at: http://gcc.gnu.org/PR31362
BR,
Pawel.
Quoted 10 lines · Paweł Sikora
Hi,
The recent gcc (3.4/4.x) optimizer inlines functions across sections which is definitely not we want, e.g. inlining functions from .init.text section.
I think, the
__init' macro needsnoinline' attribute and all thestatic inline __{dev}init' functions needinline' attribute removal to avoid gcc error (inlining failed, function not inlinable).
init functions should only ever be called from other init functions.
So this should not happen. If it happens the annotations need to be fixed.
This is already warned for for modules at build time with pending patches to do the same for vmlinux.
There are already a couple of patches pending for this and many went into .21.
-Andi
Quoted 6 lines · Paweł Sikora
The recent gcc (3.4/4.x) optimizer inlines functions across sections which is definitely not we want, e.g. inlining functions from .init.text section.
I think, the
__init' macro needsnoinline' attribute and all
An function from the .init section may very well inline a function from the regular section, though.
Jan
Quoted 4 lines · Andi Kleen
init functions should only ever be called from other init functions.
So this should not happen. If it happens the annotations need to be fixed.
I've seen some versions of gcc inline weak functions too.
J
Quoted 6 lines · Jeremy Fitzhardinge
Quoted 3 lines · Andi Kleen
init functions should only ever be called from other init functions.
So this should not happen. If it happens the annotations need to be fixed.
I've seen some versions of gcc inline weak functions too.
Please be more precise:
- gcc version
- example code
- bug number in the gcc Bugzilla
This would also help understanding what you are talking about:
- Did gcc inline a global function?
- Or was a static function declared as weak (which might be an error by the programmer)?
- ...
Quoted 1 line
J
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 8 lines · Adrian Bunk
Quoted 6 lines · Jeremy Fitzhardinge
Quoted 4 lines · Andi Kleen
init functions should only ever be called from other init functions.
So this should not happen. If it happens the annotations need to be fixed.
Quoted 8 lines
Quoted 2 lines
I've seen some versions of gcc inline weak functions too.
Please be more precise:
- gcc version
- example code
- bug number in the gcc Bugzilla
Sorry, it was a while ago, and I didn't take the time to fully report it. It was FC6 on x86_64, doing a 32-bit cross-build. I'll see if I can repro it.
Quoted 6 lines
This would also help understanding what you are talking about:
- Did gcc inline a global function?
- Or was a static function declared as weak (which might be an error by the programmer)?
- ...
It was, specifically, smp_setup_processor_id getting inlined into start_kernel.
J