public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/95131] New: Instantiate templates at pch generation time
@ 2020-05-14 13:20 trass3r at gmail dot com
  2020-05-14 13:38 ` [Bug pch/95131] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: trass3r at gmail dot com @ 2020-05-14 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95131
           Summary: Instantiate templates at pch generation time
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: pch
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trass3r at gmail dot com
  Target Milestone: ---

Judging by the limited information -ftime-report provides it looks like gcc
still spends quite some time on things that could have been done at pch
generation time already like template instantiations.

This was already noted in
https://gcc.gnu.org/wiki/Speedup_areas#Improvements_to_PCH
The page should be updated if this is not true anymore.

Clang has a similar problem that is currently being addressed:
https://llunak.blogspot.com/2019/11/clang-precompiled-headers-and-improving.html
https://reviews.llvm.org/D69585

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug pch/95131] Instantiate templates at pch generation time
  2020-05-14 13:20 [Bug pch/95131] New: Instantiate templates at pch generation time trass3r at gmail dot com
@ 2020-05-14 13:38 ` rguenth at gcc dot gnu.org
  2020-05-14 13:43 ` nathan at gcc dot gnu.org
  2020-05-15 10:17 ` trass3r at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-14 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Modules are the future, not sure how this applies there.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug pch/95131] Instantiate templates at pch generation time
  2020-05-14 13:20 [Bug pch/95131] New: Instantiate templates at pch generation time trass3r at gmail dot com
  2020-05-14 13:38 ` [Bug pch/95131] " rguenth at gcc dot gnu.org
@ 2020-05-14 13:43 ` nathan at gcc dot gnu.org
  2020-05-15 10:17 ` trass3r at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2020-05-14 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
1) The future is sooner than you think :)

2) template instantiation cannot be done speculatively -- only when language
constructs require it.  Otherwise you can change the meaning of well-formed
code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug pch/95131] Instantiate templates at pch generation time
  2020-05-14 13:20 [Bug pch/95131] New: Instantiate templates at pch generation time trass3r at gmail dot com
  2020-05-14 13:38 ` [Bug pch/95131] " rguenth at gcc dot gnu.org
  2020-05-14 13:43 ` nathan at gcc dot gnu.org
@ 2020-05-15 10:17 ` trass3r at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: trass3r at gmail dot com @ 2020-05-15 10:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Trass3r <trass3r at gmail dot com> ---
Well sure but most existing codebases won't be ported to modules because of the
effort while enabling pch is now straightforward with latest CMake.

These conformance issues have also been identified in
https://reviews.llvm.org/D69585#1946765,
which is why a flag -fpch-instantiate-templates was suggested.

For C++20 header unit compilation this behavior is actually required it seems,
so at least if -fmodule-header reuses pch code this may be a low-hanging fruit.


Is anything else from the wiki valid?
"Mangle names, instantiate templates, and generate debug information at pch
generation time"

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-15 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 13:20 [Bug pch/95131] New: Instantiate templates at pch generation time trass3r at gmail dot com
2020-05-14 13:38 ` [Bug pch/95131] " rguenth at gcc dot gnu.org
2020-05-14 13:43 ` nathan at gcc dot gnu.org
2020-05-15 10:17 ` trass3r at gmail dot com

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).