From: Adrian Bunk <bunk@fs.tum.de>
To: Arjan van de Ven <arjanv@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
Nigel Cunningham <ncunningham@linuxmail.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [2.6 patch] Re: GCC 3.4 and broken inlining.
Date: Fri, 9 Jul 2004 00:16:35 +0200 [thread overview]
Message-ID: <20040708221635.GK28324@fs.tum.de> (raw)
In-Reply-To: <20040708210925.GA13908@devserv.devel.redhat.com>
On Thu, Jul 08, 2004 at 11:09:26PM +0200, Arjan van de Ven wrote:
> On Thu, Jul 08, 2004 at 10:52:25PM +0200, Adrian Bunk wrote:
> > > marked as inline, but there are still cases when it decides not to inline
> > > for various reasons. E.g. in C++ world, lots of things are inline, yet
> > > honoring that everywhere would mean very inefficient huge programs.
> > > If a function relies for correctness on being inlined, then it should use
> > > inline __attribute__((always_inline)).
> >
> > include/linux/compiler-gcc3.h says:
> >
> > <-- snip -->
> >
> > #if __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 4
> > # define inline __inline__ __attribute__((always_inline))
> > # define __inline__ __inline__ __attribute__((always_inline))
> > # define __inline __inline__ __attribute__((always_inline))
> > #endif
> >
> > <-- snip -->
> >
> >
> > @Arjan:
> > This was added as part of your
> > [PATCH] ia32: 4Kb stacks (and irqstacks) patch
> > What's the recommended solution for Nigel's problem?
>
> the problem I've seen is that when gcc doesn't honor normal inline, it will
> often error out if you always inline....
> I'm open to removing the < 4 but as jakub said, 3.4 is quit good at honoring
> normal inline, and when it doesn't there often is a strong reason.....
I'm suggesting the following patch to remove the < 4 :
#define inline as __attribute__((always_inline)) also for gcc >= 3.4
Rationale:
- if gcc 3.4 can't inline a function marked as "inline" that's a
strong hint that further investigation is required
- I strongly prefer a compile error over a potential runtime problem
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
--- linux-2.6.7-mm6-full-gcc3.4/include/linux/compiler-gcc3.h.old 2004-07-08 23:40:27.000000000 +0200
+++ linux-2.6.7-mm6-full-gcc3.4/include/linux/compiler-gcc3.h 2004-07-08 23:40:37.000000000 +0200
@@ -3,7 +3,7 @@
/* These definitions are for GCC v3.x. */
#include <linux/compiler-gcc.h>
-#if __GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 4
+#if __GNUC_MINOR__ >= 1
# define inline __inline__ __attribute__((always_inline))
# define __inline__ __inline__ __attribute__((always_inline))
# define __inline __inline__ __attribute__((always_inline))
next prev parent reply other threads:[~2004-07-08 22:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-08 11:46 Nigel Cunningham
2004-07-08 12:07 ` Jakub Jelinek
2004-07-08 12:11 ` Nigel Cunningham
[not found] ` <200407090036.39323.vda@port.imtp.ilyichevsk.odessa.ua>
2004-07-08 22:00 ` Nigel Cunningham
2004-07-08 22:41 ` Zan Lynx
2004-07-09 6:54 ` Arjan van de Ven
2004-07-10 21:20 ` Alexandre Oliva
2004-07-08 20:52 ` Adrian Bunk
2004-07-08 21:09 ` Arjan van de Ven
2004-07-08 22:08 ` Nigel Cunningham
2004-07-08 22:25 ` Adrian Bunk
2004-07-08 22:37 ` Nigel Cunningham
2004-07-09 6:24 ` Arjan van de Ven
2004-07-10 1:21 ` Adrian Bunk
2004-07-10 2:30 ` William Lee Irwin III
2004-07-13 22:19 ` Timothy Miller
2004-07-10 6:31 ` Arjan van de Ven
2004-07-08 22:16 ` Adrian Bunk [this message]
2004-07-10 21:17 ` Alexandre Oliva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040708221635.GK28324@fs.tum.de \
--to=bunk@fs.tum.de \
--cc=arjanv@redhat.com \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ncunningham@linuxmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome