All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Cc: rth@twiddle.net
Subject: __attribute__((always_inline)) fiasco
Date: 23 Sep 2004 12:26:18 -0400	[thread overview]
Message-ID: <1095956778.4966.940.camel@cube> (raw)

> I'm displeased with someone's workaround for decisions made by
> the (rather weak) inliner in gcc 3.[123].  In particular, that
> someone doesn't understand all of the implications of always_inline.
...
> In the Alpha port I have a number of places in which I have 
> functions that I would like inlined when they are called directly,
> but I also need to take their address so that they may be registered
> as part of a dispatch vector for the specific machine model.
>
> This scheme fails because my functions got marked always_inline
> behind my back, which means they didn't get emitted in the right
> place.

If it hurts, don't do that. It looks like bloat anyway.

Are benchmarks significantly affected if you remove the inline?
If so, simply have a second function:

extern void uninline_foo(void);
...
void uninline_foo(void)
{
        foo();
}

> Rather than fight the unwinnable fight to remove this hack entirely,
> may I ask that at least one of the different names for inline, e.g.
> __inline__, be left un-touched so that it can be used by those that
> understand what the keyword is supposed to mean?
>
> Of course, there does not exist a variant that isn't used by all
> sorts of random code, so presumably all existing occurences would
> have to get renamed to plan "inline" in order to keep people happy..

Hey, I argued for INLINE when the static/extern changes
came along. That's the sanest, because one never knows
what the next annoying compiler will demand. Then you
can have one of:

#define INLINE
#define INLINE inline
#define INLINE static inline  // an oxymoron
#define INLINE extern inline  // an oxymoron
#define INLINE __force_inline
#define INLINE __attribute__((always_inline))
#define INLINE _Pragma("inline")
#define INLINE __inline_or_die_you_foul_compiler
#define INLINE _Please inline



             reply	other threads:[~2004-09-23 16:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-23 16:26 Albert Cahalan [this message]
2004-09-23 16:50 ` __attribute__((always_inline)) fiasco William Lee Irwin III
2004-09-23 16:59   ` Albert Cahalan
2004-09-23 17:03   ` Richard Henderson
2004-09-23 17:21   ` viro
2004-09-23 17:33     ` William Lee Irwin III
2004-09-23 17:39       ` viro
2004-09-26  1:29   ` Tonnerre
2004-09-26  2:05     ` William Lee Irwin III
2004-09-30 16:19       ` Bill Davidsen
2004-09-23 16:54 ` Richard Henderson
2004-09-23 17:46   ` Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2004-09-23  8:47 Richard Henderson

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=1095956778.4966.940.camel@cube \
    --to=albert@users.sf.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.