aboutsummaryrefslogtreecommitdiff
path: root/libcpp/pch.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2008-12-10 17:31:07 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2008-12-10 17:31:07 +0000
commitdb89a3be51359d6fec17fbbfba81a166440623fb (patch)
tree031df0cf1ce30d17e5c1252ae913a706c0218960 /libcpp/pch.c
parentaee91ff0bdb624e4a90149b035413be2cd1d6db9 (diff)
downloadgcc-db89a3be51359d6fec17fbbfba81a166440623fb.zip
gcc-db89a3be51359d6fec17fbbfba81a166440623fb.tar.gz
gcc-db89a3be51359d6fec17fbbfba81a166440623fb.tar.bz2
re PR target/37033 (Revision 138733 breaks -g vs -g0 for PCH)
gcc/ChangeLog: PR target/37033 * dwarf2out.c (saved_do_cfi_asm): New. (dwarf2out_do_frame): Take it into account. (dwarf2out_d_cfi_asm): Likewise. Set it when appropriate. libcpp/ChangeLog: PR target/37033 * pch.c (cpp_valid_state): Improve message for poisoned symbols. Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM. From-SVN: r142652
Diffstat (limited to 'libcpp/pch.c')
-rw-r--r--libcpp/pch.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/libcpp/pch.c b/libcpp/pch.c
index bf7b9be..f459d2c 100644
--- a/libcpp/pch.c
+++ b/libcpp/pch.c
@@ -1,5 +1,5 @@
/* Part of CPP library. (Precompiled header reading/writing.)
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2008
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -477,11 +477,32 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
h = cpp_lookup (r, namebuf, m.name_length);
if (m.flags & NODE_POISONED
- || h->type != NT_MACRO
|| h->flags & NODE_POISONED)
{
if (CPP_OPTION (r, warn_invalid_pch))
cpp_error (r, CPP_DL_WARNING_SYSHDR,
+ "%s: not used because `%.*s' is poisoned",
+ name, m.name_length, namebuf);
+ goto fail;
+ }
+
+ if (h->type != NT_MACRO)
+ {
+ /* It's ok if __GCC_HAVE_DWARF2_CFI_ASM becomes undefined,
+ as in, when the PCH file is created with -g and we're
+ attempting to use it without -g. Restoring the PCH file
+ is supposed to bring in this definition *and* enable the
+ generation of call frame information, so that precompiled
+ definitions that take this macro into accout, to decide
+ what asm to emit, won't issue .cfi directives when the
+ compiler doesn't. */
+ if (!(h->flags & NODE_USED)
+ && m.name_length == sizeof ("__GCC_HAVE_DWARF2_CFI_ASM") - 1
+ && !memcmp (namebuf, "__GCC_HAVE_DWARF2_CFI_ASM", m.name_length))
+ continue;
+
+ if (CPP_OPTION (r, warn_invalid_pch))
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' not defined",
name, m.name_length, namebuf);
goto fail;