inlining: do not allow gcc below version 4 to optimize inlining
PATCH 1/1 inlining: do not allow gcc below version 4 to optimize inlining
fix the condition to match intention: always use the old inlining behavior on all gcc versions below 4.
this should solve the UML build problem.
--- include/linux/compiler-gcc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/compiler-gcc.h +3 -2
@@ -29,10 +29,11 @@BUILD_BUG_ON_ZERO (__builtin_types_compatible_p (typeof (a),typeof (&a[0 ])))/* -* Force always-inline if the user requests it so via the .config: +* Force always-inline if the user requests it so via the .config, +* or if gcc is too old: */#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING ) || \ - !defined(CONFIG_OPTIMIZE_INLINING ) && (__GNUC__ >=4 ) + !defined(CONFIG_OPTIMIZE_INLINING ) || (__GNUC__ <4 )# define inline inline __attribute__((always_inline))# define __inline__ __inline__ __attribute__((always_inline))# define __inline __inline __attribute__((always_inline))
Quoted 5 lines · Ingo Molnar
fix the condition to match intention: always use the old inlining behavior on all gcc versions below 4.
this should solve the UML build problem.
You reported this problem.
Does it fix the problem you reported or not?
Quoted 10 lines
Signed-off-by Ingo Molnar <[email protected]>--- include/linux/compiler-gcc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)Index:
linux-x86.q/include/linux/compiler-gcc.h
===================================================================
include/linux/compiler-gcc.h line 35
Quoted 9 lines
include/linux/compiler-gcc.h +2
-2@@ -29,10 +29,11 @@BUILD_BUG_ON_ZERO (__builtin_types_compatible_p (typeof (a),typeof (&a[0 ])))/* -* Force always-inline if the user requests it so via the .config: +* Force always-inline if the user requests it so via the .config, +* or if gcc is too old: */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ - !defined(CONFIG_OPTIMIZE_INLINING ) && (__GNUC__ >=4 )
One moment.
Let me try to understand what we currently have in the tree.
This *always* enables the so called "optimized inlining" for the older compilers we did *not* wanted to have this for.
Even with CONFIG_OPTIMIZE_INLINING=n .
How was this reviewed and tested?
include/linux/compiler-gcc.h line 39
Quoted 4 lines
include/linux/compiler-gcc.h +1
-0+ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)# define inline inline __attribute__((always_inline))# define __inline__ __inline__ __attribute__((always_inline))# define __inline __inline __attribute__((always_inline))
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 10 lines · Adrian Bunk
Quoted 7 lines
/*
- * Force always-inline if the user requests it so via the .config:
+ * Force always-inline if the user requests it so via the .config,
+ * or if gcc is too old:
*/
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
- !defined(CONFIG_OPTIMIZE_INLINING) && (__GNUC__>= 4)One moment.
Quoted 8 lines
Let me try to understand what we currently have in the tree.
This *always* enables the so called "optimized inlining" for the older compilers we did *not* wanted to have this for.
Even with
CONFIG_OPTIMIZE_INLINING=n.How was this reviewed and tested?
I for one reviewed this.
No I did not catch the obvious bug and
feel free to flame me for that.
Sam
Quoted 11 lines · Adrian Bunk
Quoted 5 lines · Ingo Molnar
fix the condition to match intention: always use the old inlining behavior on all gcc versions below 4.
this should solve the UML build problem.
You reported this problem.
Does it fix the problem you reported or not?
...
I just tested it.
It does not fix it.
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 Seed