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 ipa/107931] [12/13 Regression] -Og causes always_inline to fail since r12-6677-gc952126870c92cf2
Date: Tue, 21 Feb 2023 11:56:30 +0000	[thread overview]
Message-ID: <bug-107931-4-aW0XZwcR8d@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107931-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #20 from Jan Hubicka <hubicka at ucw dot cz> ---
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
> 
> --- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> ---
> On Mon, 20 Feb 2023, jakub at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
> > 
> > --- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> > As discussed elsewhere, always_inline is used in various ways, in some users I
> > guess would like to see an error if it wasn't inlined, but e.g. the uses in
> > glibc for _FORTIFY_SOURCE where many of the standard C or POSIX APIs have
> > extern inline wrappers with always_inline and gnu_inline attributes.  In that
> > case always_inline is used there for security reasons (not inlining it means
> > the security checks aren't done) but on the other side C/POSIX requires &open
> > or &printf to work too.
> 
> With GNU extern inline always_inline it would work to never emit bodies
> of always_inline functions to get the errors diagnosed at link time.
> Possibly standard C inline plus always_inline would work the same if we
> then treat the out of line instantiation as the destination for indirect
> calls.
> 
> But I think the cgraph code is still not 100% accurate in reflecting
> reality with extern inlines (and possibly C 'inline' and instantiations),
> since it doesn't treat the inline copy and the out of line copy 
> separately.
Yep, when inline version is replaced by offline version we forget inline
version. THis is remainer from one-definition rule work Zack did many years
ago. He changed C and C++ frontned to not produce duplciated
VAR/FUNCTION_DECLs with same assembler names and do in-place
replacements instead.  This was never fully finished and we get
duplciates in some scnearios.

In meantime cgraph knows how to handle this for LTO and we also support
weakrefs and syntactic aliases so keeping both definitions around is not
too hard from cgraph point of view.  We will however need to convince
front-ends to not overwrite the original decl holding the extern inline
body.

Honza

  parent reply	other threads:[~2023-02-21 11:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  7:52 [Bug c/107931] New: [12 Regression] -Od causes always_inline to fail me at xenu dot pl
2022-11-30  7:55 ` [Bug c/107931] [12 Regression] -Og " me at xenu dot pl
2022-11-30 12:30 ` [Bug ipa/107931] [12/13 Regression] -Og causes always_inline to fail since r12-6677-gc952126870c92cf2 marxin at gcc dot gnu.org
2022-11-30 12:52 ` rguenth at gcc dot gnu.org
2022-12-01 15:34 ` jakub at gcc dot gnu.org
2022-12-01 17:59 ` me at xenu dot pl
2022-12-01 18:02 ` jakub at gcc dot gnu.org
2022-12-02  7:22 ` rguenther at suse dot de
2022-12-21 10:44 ` rguenth at gcc dot gnu.org
2023-02-17 10:16 ` sam at gentoo dot org
2023-02-18  6:32 ` ishikawa at yk dot rim.or.jp
2023-02-18  6:35 ` ishikawa at yk dot rim.or.jp
2023-02-18  7:05 ` pinskia at gcc dot gnu.org
2023-02-18  7:10 ` pinskia at gcc dot gnu.org
2023-02-18 23:34 ` ishikawa at yk dot rim.or.jp
2023-02-20  7:49 ` rguenth at gcc dot gnu.org
2023-02-20 10:40 ` jakub at gcc dot gnu.org
2023-02-20 10:51 ` rguenther at suse dot de
2023-02-21  7:33 ` ishikawa at yk dot rim.or.jp
2023-02-21  7:36 ` rguenther at suse dot de
2023-02-21 11:56 ` hubicka at ucw dot cz [this message]
2023-05-08 12:26 ` [Bug ipa/107931] [12/13/14 " rguenth at gcc dot gnu.org
2024-01-12 10:11 ` rguenth at gcc dot gnu.org
2024-01-12 10:26 ` jakub at gcc dot gnu.org
2024-01-12 11:56 ` rguenth at gcc dot gnu.org
2024-01-23  8:31 ` rguenth at gcc dot gnu.org
2024-01-23  8:39 ` jakub at gcc dot gnu.org
2024-01-23 10:30 ` rguenther at suse dot de

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-107931-4-aW0XZwcR8d@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).