From: Andi Kleen <ak@muc.de>
To: Adrian Bunk <bunk@fs.tum.de>
Cc: ncunningham@linuxmail.org, linux-kernel@vger.kernel.org
Subject: Re: GCC 3.4 and broken inlining.
Date: 10 Jul 2004 06:50:28 +0200
Date: Sat, 10 Jul 2004 06:50:28 +0200 [thread overview]
Message-ID: <20040710045028.GA55490@muc.de> (raw)
In-Reply-To: <20040709221755.GU28324@fs.tum.de>
On Sat, Jul 10, 2004 at 12:17:55AM +0200, Adrian Bunk wrote:
> On Fri, Jul 09, 2004 at 11:54:15PM +0200, Andi Kleen wrote:
> > > Runtime errors caused with gcc 3.4 are IMHO much worse than such a small
> > > improvement or three dozen compile errors with gcc 3.4 .
> >
> > What runtime errors?
> >
> > Actually requiring inlining is extremly rare and such functions should
> > get that an explicit always inline just for documentation purposes.
> > (another issue is not optimized away checks, but that shows at link time)
>
> First of all, your proposed patch seems to be broken WRT gcc < 3.1 .
The latest version does fallback #define __always_inline inline
That was indeed broken in the original patch.
>
> > In the x86-64 case it was vsyscalls, in Nigel's case it was swsusp.
> > Both are quite exceptional in what they do.
> >
> > > Wouldn't it be a better solution if you would audit the existing inlines
> > > in the kernel for abuse of inline and fix those instead?
> >
> > I don't see any point in going through ~1.2MLOC of code by hand
> > when a compiler can do it for me.
>
> How can a compiler decide whether an "inline" was for a possible small
> speed benefit or whether it's required for correct working?
It can't, but the 0.001% of needed for inlines that are required
for correctness should be always marked __always_inline
just for documentation alone.
You probably don't realize how special a case this is.
> And I'm not that happy with the fact that gcc 3.3 and gcc 3.4 will
> produce significantly different code for the same file. Besides from the
> 3 dozen compile errors I'm currently sorting out, gcc 3.3 and 3.4 should
> behave similar with __attribute__((always_inline)).
They are different compiler versiopns, they generate different code.
-Andi
next prev parent reply other threads:[~2004-07-10 4:50 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2fFzK-3Zz-23@gated-at.bofh.it>
[not found] ` <2fG2F-4qK-3@gated-at.bofh.it>
[not found] ` <2fG2G-4qK-9@gated-at.bofh.it>
[not found] ` <2fPfF-2Dv-21@gated-at.bofh.it>
[not found] ` <2fPfF-2Dv-19@gated-at.bofh.it>
2004-07-09 4:51 ` GCC 3.4 and broken inlining Andi Kleen
2004-07-09 4:56 ` Nigel Cunningham
2004-07-09 5:46 ` Andi Kleen
2004-07-09 9:43 ` Michael Buesch
2004-07-09 10:23 ` Paweł Sikora
2004-07-10 21:33 ` Alexandre Oliva
2004-07-11 5:52 ` Andi Kleen
2004-07-14 3:00 ` Alexandre Oliva
2004-07-09 18:40 ` Adrian Bunk
2004-07-09 21:54 ` Andi Kleen
2004-07-09 22:17 ` Adrian Bunk
2004-07-10 4:50 ` Andi Kleen [this message]
2004-07-10 21:25 ` Alexandre Oliva
2004-07-11 5:53 ` Andi Kleen
2004-07-11 6:55 ` Andrew Morton
2004-07-11 8:26 ` Andi Kleen
2004-07-11 8:32 ` Andrew Morton
2004-07-11 9:08 ` Andi Kleen
2004-07-11 11:50 ` Adrian Bunk
2004-07-11 13:01 ` Arnd Bergmann
2004-07-13 1:02 ` [updated 2.6 patch] #define inline as __attribute__((always_inline)) also for gcc >= 3.4 Adrian Bunk
[not found] <fa.hnj36kg.4no2jk@ifi.uio.no>
[not found] ` <fa.gktbdsg.1n4em8o@ifi.uio.no>
2004-07-10 3:12 ` GCC 3.4 and broken inlining Robert Hancock
[not found] <2fVEt-6Vy-11@gated-at.bofh.it>
[not found] ` <2fVO5-79H-3@gated-at.bofh.it>
[not found] ` <2fWqQ-7uv-19@gated-at.bofh.it>
[not found] ` <2g0b6-1Cf-23@gated-at.bofh.it>
2004-07-09 10:04 ` Andi Kleen
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-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=20040710045028.GA55490@muc.de \
--to=ak@muc.de \
--cc=bunk@fs.tum.de \
--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