public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] inlining: do not allow gcc below version 4 to optimize inlining
@ 2008-04-29 22:15 Ingo Molnar
  2008-04-30 19:03 ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2008-04-29 22:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Thomas Gleixner, H. Peter Anvin


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.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/compiler-gcc.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-x86.q/include/linux/compiler-gcc.h
===================================================================
--- linux-x86.q.orig/include/linux/compiler-gcc.h
+++ linux-x86.q/include/linux/compiler-gcc.h
@@ -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))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] inlining: do not allow gcc below version 4 to optimize inlining
  2008-04-29 22:15 [patch] inlining: do not allow gcc below version 4 to optimize inlining Ingo Molnar
@ 2008-04-30 19:03 ` Adrian Bunk
  2008-04-30 19:58   ` Sam Ravnborg
  2008-04-30 20:38   ` Adrian Bunk
  0 siblings, 2 replies; 4+ messages in thread
From: Adrian Bunk @ 2008-04-30 19:03 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin

On Wed, Apr 30, 2008 at 12:15:31AM +0200, Ingo Molnar wrote:
> 
> 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?

> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  include/linux/compiler-gcc.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Index: linux-x86.q/include/linux/compiler-gcc.h
> ===================================================================
> --- linux-x86.q.orig/include/linux/compiler-gcc.h
> +++ linux-x86.q/include/linux/compiler-gcc.h
> @@ -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?

> +    !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

-- 

       "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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] inlining: do not allow gcc below version 4 to optimize inlining
  2008-04-30 19:03 ` Adrian Bunk
@ 2008-04-30 19:58   ` Sam Ravnborg
  2008-04-30 20:38   ` Adrian Bunk
  1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2008-04-30 19:58 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Ingo Molnar, Linus Torvalds, linux-kernel, Thomas Gleixner,
	H. Peter Anvin

On Wed, Apr 30, 2008 at 10:03:07PM +0300, Adrian Bunk wrote:
> >  /*
> > - * 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?

I for one reviewed this.
No I did not catch the obvious bug and
feel free to flame me for that.

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] inlining: do not allow gcc below version 4 to optimize inlining
  2008-04-30 19:03 ` Adrian Bunk
  2008-04-30 19:58   ` Sam Ravnborg
@ 2008-04-30 20:38   ` Adrian Bunk
  1 sibling, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2008-04-30 20:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, H. Peter Anvin

On Wed, Apr 30, 2008 at 10:03:07PM +0300, Adrian Bunk wrote:
> On Wed, Apr 30, 2008 at 12:15:31AM +0200, Ingo Molnar wrote:
> > 
> > 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

-- 

       "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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-30 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 22:15 [patch] inlining: do not allow gcc below version 4 to optimize inlining Ingo Molnar
2008-04-30 19:03 ` Adrian Bunk
2008-04-30 19:58   ` Sam Ravnborg
2008-04-30 20:38   ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox