public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94960] extern template prevents inlining of standard library objects
Date: Thu, 17 Feb 2022 23:54:45 +0000	[thread overview]
Message-ID: <bug-94960-4-LH7M8oy1xQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94960-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94960

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Erich Keane from comment #6)
> (In reply to Jonathan Wakely from comment #5)
> > And if we have to mark every single function as 'inline' then maybe the
> > compiler shouldn't be using it as a hint.
> 
> I don't think the idea is to mark EVERY function 'inline', simply ones that
> are pretty tiny and really good candidates for inlining.

But that's exactly what we do. _M_construct isn't tiny, it has two loops (and
until quite recently, a try-catch block, but that's been replaced). There are
some functions in <bits/basic_string.tcc> which are probably small enough to be
marked 'inline', so I should review those. Not for GCC 12 though.

But in C++20 every function is 'constexpr' now, so every function is inline
anyway, right? Even the large functions that aren't good candidates for
inlining (see also PR 93008). So The 'inline' keyword has lost all meaning in
<string> now.

  parent reply	other threads:[~2022-02-17 23:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 20:09 [Bug libstdc++/94960] New: " krzysio.kurek at wp dot pl
2020-05-05 21:02 ` [Bug libstdc++/94960] " pinskia at gcc dot gnu.org
2020-05-05 21:08 ` redi at gcc dot gnu.org
2020-05-06  0:19 ` erich.keane at intel dot com
2020-05-06  7:05 ` [Bug c++/94960] " rguenth at gcc dot gnu.org
2020-05-06  9:11 ` redi at gcc dot gnu.org
2020-05-06 13:01 ` erich.keane at intel dot com
2022-02-17 17:01 ` jason at gcc dot gnu.org
2022-02-17 23:54 ` redi at gcc dot gnu.org [this message]
2022-02-18  0:53 ` erich.keane at intel dot com

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-94960-4-LH7M8oy1xQ@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).