public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: axboe@suse.de, wli@holomorphy.com,
	B.Zolnierkiewicz@elka.pw.edu.pl, akpm@osdl.org,
	dgilbert@interlog.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH][2.6.8-rc1-mm1] drivers/scsi/sg.c gcc341 inlining fix
Date: Thu, 15 Jul 2004 09:09:38 -0400	[thread overview]
Message-ID: <40F68212.2020405@pobox.com> (raw)
In-Reply-To: <200407150946.i6F9kqXn010635@harpo.it.uu.se>

Mikael Pettersson wrote:
> On Wed, 14 Jul 2004 23:12:54 -0700, William Lee Irwin III wrote:
> 
>>Jeff Garzik <jgarzik@pobox.com> wrote:
>>
>>>>>Or you could just call it "gcc is dumb" rather than a compiler bug.
>>
>>On Wed, Jul 14 2004, Andrew Morton wrote:
>>[... code snippet ...]
>>
>>>>is pretty dumb too.  I don't see any harm if this compiler feature/problem
>>>>pushes us to fix the above in the obvious way.
>>
>>On Thu, Jul 15, 2004 at 07:56:56AM +0200, Jens Axboe wrote:
>>
>>>Excuse my ignorance, but why on earth would that be dumb? Looks
>>>perfectly legit to me, and I have to agree with Jeff that the compiler
>>>is exceedingly dumb if it fails to inline that case.
>>
>>Enter gcc...
>>
>>Maybe "the obvious way" is sending a someone off to whip gcc into shape,
>>or possibly reporting it as a gcc problem.
> 
> 
> It shows you guys aren't compiler writers.

Actually, I have written most of a [simple] compiler backend.


> Compilers for top-down (define-before-use) languages like C
> have traditionally also worked in a top-down fashion, processing
> one top-level declaration at a time. Forward references are
> either errors, or are (when a proper declaration is in scope)
> left to the linker to resolve.
> 
> Processing an entire compilation-unit (e.g. whole C file)
> as a single unit is typically _only_ done when either the
> language semantics requires it (not C, but e.g. Haskell),
> or when very high optimisation levels are requested.

Or in the case where you parse the entire file, then generate code for 
the entire file in a separate pass.  Which does NOT imply 
unit-at-a-time, for the readers at home.  It just implies generation of 
the AST.


> In the case of gcc-3.4.1 failing to inline, you are asking
> gcc to do something (peeking forward) which it never has
> promised to do. And with the kernel using -fno-unit-at-a-time
> for stack conservation reasons, gcc is actually being _told_
> not to do global compilation.
> 
> This is not a gcc bug, nor is it being "exceedingly dumb".

Actually, yes it is.

	Jeff



  reply	other threads:[~2004-07-15 13:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-15  9:46 [PATCH][2.6.8-rc1-mm1] drivers/scsi/sg.c gcc341 inlining fix Mikael Pettersson
2004-07-15 13:09 ` Jeff Garzik [this message]
2004-07-15 15:58   ` Matthew Wilcox
2004-07-15 14:36 ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2004-07-14 17:51 Mikael Pettersson
2004-07-14 18:36 ` Jeff Garzik
2004-07-14 19:05   ` Adrian Bunk
2004-07-14 21:35   ` Andrew Morton
2004-07-14 23:39     ` Jeff Garzik
2004-07-14 22:39       ` Andrew Morton
2004-07-15  0:19       ` Matthew Wilcox
2004-07-15  5:56     ` Jens Axboe
2004-07-15  6:12       ` William Lee Irwin III
2004-07-15 15:42     ` Douglas Gilbert
2004-07-14 12:16 Mikael Pettersson
2004-07-14 15:52 ` Jeff Garzik
2004-07-14 16:42   ` Adrian Bunk
2004-07-14 16:44     ` Jeff Garzik
2004-07-14 16:54       ` Adrian Bunk
2004-07-14 17:31         ` Bartlomiej Zolnierkiewicz
2004-07-14 18:33           ` Adrian Bunk
2004-07-14 18:44             ` Jeff Garzik
2004-07-14 19:06             ` Douglas Gilbert
2004-07-26 22:09             ` Andrew Morton
2004-07-14 18:34           ` Jeff Garzik
2004-07-14 18:31         ` Jeff Garzik
2004-07-14 15:57 ` Bartlomiej Zolnierkiewicz
2004-07-14 15:59   ` Jeff Garzik
2004-07-26 21:53 ` Andrew Morton

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=40F68212.2020405@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=dgilbert@interlog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    --cc=wli@holomorphy.com \
    /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