mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: Alexey Dobriyan <adobriyan@gmail.com>, Paul Jackson <pj@sgi.com>,
	paulus@samba.org, torvalds@osdl.org,
	linux-kernel@vger.kernel.org
Subject: Re: Linux-2.6.13-rc7
Date: Thu, 25 Aug 2005 23:51:52 +0100	[thread overview]
Message-ID: <20050825225152.GZ9322@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20050825221649.GA31305@twiddle.net>

On Thu, Aug 25, 2005 at 03:16:49PM -0700, Richard Henderson wrote:
> On Thu, Aug 25, 2005 at 08:07:55PM +0100, Al Viro wrote:
> > IMO that's a question to rth: why do we really need to block always_inline
> > on alpha?
> 
> Because I use "extern inline" in the proper way.  That is, I have both
> inline and out-of-line versions of some routines.  These routines have
> their address taken to be put into the alpha_machine_vector structures,
> so we're guaranteed that they'll be out-of-line at least once.
> 
> But if you define inline to always_inline, the compiler complains when
> its forced to fall back to the out-of-line copy.  And rightly so -- the
> feature was INVENTED for using compiler intrinsics that would in fact
> not produce valid assembly unless certain parameters are constants.
> 
> I've complained about this before.  You always-inline savages have 
> obsconded with ALL THREE inline keywords -- "inline", "__inline" and
> "__inline__" -- so there is in fact no way to accomplish what I want.
> 
> So in a fit of pique I've locally undone not just one, but all of the
> always-inline crap.
> 
> All that said, something's wrong if we couldn't generate an out-of-line
> copy of kmalloc.  The entire block protected by __builtin_constant_p
> should have been eliminated.  File a gcc bugzilla report.  

It is eliminated.  As the result, the compile-time checks disappear.
In this case it's more or less harmless - we miss some bugs that could
be caught at compile time, but that's it.  In case of e.g. xchg() (same
technics of calling undefined function in the code that gets eliminated
if everything's right) it gave genuine bugs - gcc decided to create an
uninlined copy and to hell it went:

static inline unsigned long
__xchg(volatile void *ptr, unsigned long x, int size)
{
        switch (size) {
                case 1:
                        return __xchg_u8(ptr, x);
                case 2:
                        return __xchg_u16(ptr, x);
                case 4:
                        return __xchg_u32(ptr, x);
                case 8:
                        return __xchg_u64(ptr, x);
        }
        __xchg_called_with_bad_pointer();
        return x;
}
#define xchg(ptr,x)                                                          \
  ({                                                                         \
     __typeof__(*(ptr)) _x_ = (x);                                           \
     (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
  })

blows to hell, since we have no way to tell gcc that it should _never_
be done non-inlined.  Well, no way short of making __xchg a macro...

So what do you propose to use for that class of compile-time checks?
#define whenever they are used?

  reply	other threads:[~2005-08-25 22:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24  5:08 Linux-2.6.13-rc7 Linus Torvalds
2005-08-24  6:43 ` Linux-2.6.13-rc7 Al Viro
2005-08-24 11:24   ` Linux-2.6.13-rc7 Dinakar Guniguntala
2005-08-24 18:43   ` Linux-2.6.13-rc7 Paul Jackson
2005-08-24 19:15     ` Linux-2.6.13-rc7 Al Viro
2005-08-24 20:13       ` Linux-2.6.13-rc7 Alexey Dobriyan
2005-08-24 20:34         ` Linux-2.6.13-rc7 Alexey Dobriyan
2005-08-24 21:38         ` Linux-2.6.13-rc7 Al Viro
2005-08-25  7:27           ` Linux-2.6.13-rc7 Alexey Dobriyan
2005-08-25 19:07             ` Linux-2.6.13-rc7 Al Viro
2005-08-25 22:16               ` Linux-2.6.13-rc7 Richard Henderson
2005-08-25 22:51                 ` Al Viro [this message]
2005-08-27  3:58                 ` Linux-2.6.13-rc7 Mitchell Blank Jr
2005-08-25  9:29       ` Linux-2.6.13-rc7 Geert Uytterhoeven
2005-08-25 13:59         ` Linux-2.6.13-rc7 Sam Creasey
2005-08-25 14:12           ` Linux-2.6.13-rc7 Al Viro
2005-08-25 14:16             ` Linux-2.6.13-rc7 Geert Uytterhoeven
2005-08-25 14:17             ` Linux-2.6.13-rc7 Sam Creasey
2005-08-24 22:40 ` Linux-2.6.13-rc7 : OK Willy TARREAU
2005-08-25 14:04 ` Linux-2.6.13-rc7 Erik Mouw
2005-08-27  4:33   ` Linux-2.6.13-rc7 Deepak Saxena
2005-08-29 13:33     ` Linux-2.6.13-rc7 Erik Mouw
2005-08-25 17:49 ` Linux-2.6.13-rc7 Sebastian Kaergel
2005-08-25 16:23   ` Linux-2.6.13-rc7 Antonino A. Daplas
2005-08-25 19:01     ` Linux-2.6.13-rc7 Sebastian Kaergel
2005-08-25 17:45       ` Linux-2.6.13-rc7 Antonino A. Daplas
2005-08-25 18:47       ` Linux-2.6.13-rc7 Sylvain Meyer
2005-08-25 23:25         ` Linux-2.6.13-rc7 Antonino A. Daplas
2005-08-26 10:45 ` Linux-2.6.13-rc7 Danny ter Haar
2005-08-26 13:51   ` Linux-2.6.13-rc7 Danny ter Haar
2005-08-27 11:37     ` Linux-2.6.13-rc7 Danny ter Haar
2005-08-27 11:57       ` Linux-2.6.13-rc7 Danny ter Haar
2005-08-27  3:45 ` Linux-2.6.13-rc7 Masoud Sharbiani
2005-08-25  0:20 Linux-2.6.13-rc7 Voluspa

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=20050825225152.GZ9322@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=pj@sgi.com \
    --cc=torvalds@osdl.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