public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/46596] misbehavior when mixing always_inline and alias attributes in the same compilation unit
Date: Wed, 29 Feb 2012 15:16:00 -0000	[thread overview]
Message-ID: <bug-46596-4-d8BrKRFQYM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46596-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46596

--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> 2012-02-29 15:07:18 UTC ---
> glibc runs into the "sorry, unimplemented" part of the issue, with
> delta-reduced code like:
> 
> $ cat test.i
> typedef __builtin_va_list __gnuc_va_list;
> extern __inline __attribute__ ((__always_inline__)) __attribute__
> ((__artificial__)) void syslog (int __pri, const char *__fmt, ...) {
> };
> typedef __gnuc_va_list va_list;
> void __syslog(int pri, const char *fmt, ...) {
> }
> extern __typeof (__syslog) syslog __attribute__ ((alias ("__syslog")));

The problem here seems to be that typeof copies always inline attribute.
GCC before version 4.7 do not see through aliases and thus it has always
inline function that is alias but it can not see the body.  So the message
is correct.

GCC 4.7 newly understands alaises, but this was major change of the internal
representation and can not be backported.  For older GCC, i think only
workaround
is to call __syslog instead of syslog or drop the idea of using always iline
here.  Extern inlines will be inlined anyway.

Honza


  parent reply	other threads:[~2012-02-29 15:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22  3:50 [Bug c/46596] New: " vapier at gentoo dot org
2010-11-22  4:58 ` [Bug c/46596] " vapier at gentoo dot org
2010-11-22 11:11 ` rguenth at gcc dot gnu.org
2010-11-22 19:02 ` vapier at gentoo dot org
2012-02-29  9:44 ` jyasskin at gcc dot gnu.org
2012-02-29 15:16 ` hubicka at ucw dot cz [this message]
2012-02-29 16:22 ` vapier at gentoo dot org
2024-03-01 23:09 ` [Bug ipa/46596] " pinskia at gcc dot gnu.org

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=bug-46596-4-d8BrKRFQYM@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).