public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ICE with precompiled headers (GCC 8.1)
@ 2019-04-30 14:02 Paul Smith
  2019-04-30 15:34 ` Zan Lynx
  2019-05-01 13:35 ` Paul Smith
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Smith @ 2019-04-30 14:02 UTC (permalink / raw)
  To: gcc

I have GCC 8.1.0 / binutils 2.30 on GNU/Linux 64bit (built locally). 
My codebase is almost all C++.

I'm implementing precompiled headers and it was going well.  However,
sometimes a PCH file is generated that causes the compiler to ICE when
trying to use it during a source file compilation:

  <command-line>: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <https://gcc.gnu.org/bugs/> for instructions.

If I rename the .gch file and compile the source it works; if I put
back the .gch file and compile the source it will ICE again.  So
clearly there's something corrupt about the PCH file itself.

Also this does not happen every time, even using the identical code. 
Sometimes the PCH file is fine and the compile is fine.  It has never
happened on my local system but it happens quite often on some of our
build servers (typically these are a bit older/slower with slower
disks).  And, it doesn't happen to all PCH files in the same build (I
create different PCH files for different libraries), even ones that
include the same files!

Since it's not reproducible and the code is proprietary I haven't tried
to produce a publishable case so far.

Here's the thing: I added the "-MD -MF foo.d" options to the PCH file
compile (I wanted to get a manifest of which files were included in the
PCH file).  Without those options I cannot reproduce this at all (in a
number of tries).  With those options it happens most of the time on
some systems (but again, never on my local system).

Unfortunately my GCC is heavily optimized and stripped so backtraces
are useless.  I will generate a debuggable GCC and see if I can get
more info on the ICE.

In the meantime, does this remind anyone of an existing bug, hopefully
one that was fixed in 8.2 or 8.3?

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

end of thread, other threads:[~2019-05-02 11:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30 14:02 ICE with precompiled headers (GCC 8.1) Paul Smith
2019-04-30 15:34 ` Zan Lynx
2019-04-30 17:04   ` Paul Smith
2019-05-01 13:35 ` Paul Smith
2019-05-01 15:04   ` Paul Smith
2019-05-01 23:42     ` Paul Smith
2019-05-02 11:12     ` Nathan Sidwell

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