public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "siarhei.siamashka at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug d/102765] [11 Regression] GDC11 stopped inlining library functions and lambdas used by a binary search one-liner code
Date: Tue, 01 Feb 2022 03:47:18 +0000	[thread overview]
Message-ID: <bug-102765-4-cd9wwWJDCx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102765-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Siarhei Siamashka <siarhei.siamashka at gmail dot com> ---
First of all, it's my own fault for not just bisecting the GDC code from the
day one to figure out all the relevant details many months earlier. The code is
large and takes a lot of time to compile, so I was lazy. And I apologise for
this.

Now comments from https://forum.dlang.org/thread/sspkdp$1m4n$1@digitalmars.com
provided some missing bits of important information. I may be still wrong, so
please correct me if necessary, but the root cause of this performance
regression appears to be an attempt to fix the actual problem PR104317 in GDC11
via some excessively invasive PR99914 that ended up evolving GDC in a wrong
direction.

Just imagine someone encountering something like the examples from
https://stackoverflow.com/questions/3691835/why-uninitialized-global-variable-is-weak-symbol
and then suddenly making a strange conclusion that all template functions
should be non-inlineable in a C++ compiler (unless LTO is enabled). Looks like
that's exactly what happened to GDC. The D language standard documentation is
incomplete and this isn't helping. But the developers of the other D compilers
seem to have an opinion that inlining template functions is okay (due to the
same or at least similar ODR rules as in C++).

  parent reply	other threads:[~2022-02-01  3:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  6:54 [Bug d/102765] New: " siarhei.siamashka at gmail dot com
2021-11-05 13:33 ` [Bug d/102765] " rguenth at gcc dot gnu.org
2021-11-05 13:47 ` ibuclaw at gdcproject dot org
2021-12-09  2:33 ` siarhei.siamashka at gmail dot com
2022-02-01  3:47 ` siarhei.siamashka at gmail dot com [this message]
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-08-09 19:27 ` ibuclaw at gdcproject dot org
2022-10-13  5:45 ` ibuclaw at gdcproject dot org
2023-05-29 10:05 ` jakub 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-102765-4-cd9wwWJDCx@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).