public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/59626] [4.9 lto] /usr/include/bits/unistd.h:173:1: error: inlining failed in call to always_inline 'readlinkat': recursive inlining
Date: Fri, 10 Jan 2014 20:54:00 -0000	[thread overview]
Message-ID: <bug-59626-4-UQvdf8RAnG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59626-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But the function doesn't inline itself, that is why it uses the asm alias and
GCC shouldn't be looking through that and merging the two decls because of
that.

Breaking this breaks pretty much all of glibc -D_FORTIFY_SOURCE, and there
really isn't any other way how to write it.

To show the reason for the inline:
__fortify_function __nonnull ((1, 2)) __wur ssize_t
__NTH (readlink (const char *__restrict __path, char *__restrict __buf,
                 size_t __len))
{
  if (__bos (__buf) != (size_t) -1)
    {
      if (!__builtin_constant_p (__len))
        return __readlink_chk (__path, __buf, __len, __bos (__buf));

      if ( __len > __bos (__buf))
        return __readlink_chk_warn (__path, __buf, __len, __bos (__buf));
    }
  return __readlink_alias (__path, __buf, __len);
}

The inline must be always_inline, because it is a security matter if it is
inlined or not, and we want it to expand as a call to __readlink_chk if
it needs runtime verification, otherwise as a call to the original function,
not inlined.  So, this is really a LTO/IPA bug.


  parent reply	other threads:[~2014-01-10 20:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30  9:13 [Bug lto/59626] New: " nheghathivhistha at gmail dot com
2013-12-30 17:15 ` [Bug lto/59626] " trippels at gcc dot gnu.org
2014-01-07 11:53 ` rguenth at gcc dot gnu.org
2014-01-10 20:22 ` aldyh at gcc dot gnu.org
2014-01-10 20:54 ` jakub at gcc dot gnu.org [this message]
2014-01-13  8:24 ` trippels at gcc dot gnu.org
2014-01-31 11:23 ` [Bug lto/59626] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-02-16  8:25 ` trippels at gcc dot gnu.org
2014-02-25  9:21 ` rguenth at gcc dot gnu.org
2014-02-25 10:08 ` rguenth at gcc dot gnu.org
2014-02-25 10:08 ` rguenth at gcc dot gnu.org
2014-02-25 10:45 ` nheghathivhistha at gmail dot com
2014-02-25 11:04 ` rguenth at gcc dot gnu.org
2014-02-25 11:50 ` trippels at gcc dot gnu.org
2014-02-25 12:44 ` rguenth at gcc dot gnu.org
2014-02-25 13:22 ` rguenth at gcc dot gnu.org
2014-03-09 17:46 ` nheghathivhistha at gmail dot com
2014-03-21  9:35 ` rguenth at gcc dot gnu.org
2014-03-21 13:24 ` rguenth at gcc dot gnu.org
2014-03-21 13:58 ` rguenth at gcc dot gnu.org
2014-03-24 10:07 ` rguenth at gcc dot gnu.org
2014-04-04 18:03 ` hubicka at gcc dot gnu.org
2014-04-14  8:14 ` [Bug lto/59626] [4.8 " rguenth at gcc dot gnu.org
2014-05-22  9:07 ` rguenth at gcc dot gnu.org
2014-12-19 13:34 ` jakub at gcc dot gnu.org
2015-05-18 10:11 ` asolokha at gmx dot com
2015-06-11  7:45 ` rguenth at gcc dot gnu.org
2015-06-11 13:40 ` rguenth at gcc dot gnu.org
2015-06-11 13:41 ` rguenth 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-59626-4-UQvdf8RAnG@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).