This is the mail archive of the
mailing list for the GCC project.
PING Re: [patch] PR debug/46102 Disable -feliminate-dwarf2-dups when reading a PCH
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: jason merrill <jason at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Feb 2015 07:50:06 -0800
- Subject: PING Re: [patch] PR debug/46102 Disable -feliminate-dwarf2-dups when reading a PCH
- Authentication-results: sourceware.org; auth=none
- References: <54E6129C dot 5060706 at redhat dot com> <54E61314 dot 9070805 at redhat dot com> <20150219165052 dot GK1746 at tucnak dot redhat dot com> <54E62C70 dot 8020208 at redhat dot com> <20150219184143 dot GN1746 at tucnak dot redhat dot com>
On 02/19/2015 10:41 AM, Jakub Jelinek wrote:
On Thu, Feb 19, 2015 at 10:33:20AM -0800, Aldy Hernandez wrote:
Well, any PCH file we generate will have some sort of early DIE in it (at
the very least the compilation unit DIE) and we will read these in at PCH
read-in time, obliterating whatever was already there. But most
importantly, with the attached patch we will not use these
DW_TAG_GNU_[BE]INCL* DIEs, since the reader will avoid reading the pch file.
So, I don't think erroring out at output time is necessary.
How does this look?
Looks reasonable to me, but I'd prefer to defer this to Jason as debug
Author: Aldy Hernandez <email@example.com>
Date: Thu Feb 19 07:35:59 2015 -0800
* c-pch.c (c_common_valid_pch): Mark PCH file with
-feliminate-dwarf2-dups as invalid.
diff --git a/gcc/c-family/c-pch.c b/gcc/c-family/c-pch.c
index 0ede92a..55163c9 100644
@@ -224,6 +224,19 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
const char *pch_ident;
struct c_pch_validity v;
+ /* We may have outputted a few DIEs corresponding to
+ DW_TAG_GNU_[BE]INCL. Reading the compiler state later will read
+ in these DIEs, and obliterate any DW_TAG_GNU_[BE]INCL the reader
+ may have generated itself. Do not read the PCH if this may
+ happen. */
+ if (flag_eliminate_dwarf2_dups)
+ if (cpp_get_options (pfile)->warn_invalid_pch)
+ cpp_error (pfile, CPP_DL_WARNING,
+ "%s: cannot be used with -feliminate-dwarf2-dups", name);
+ return 2;
/* Perform a quick test of whether this is a valid
precompiled header for the current language. */