summaryrefslogtreecommitdiff
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
parentaee91ff0bdb624e4a90149b035413be2cd1d6db9 (diff)
downloadgcc-db89a3be51359d6fec17fbbfba81a166440623fb.tar.gz
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c8
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/pch.c25
4 files changed, 42 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a32639ef97d..2a1d73f6685 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2008-12-10 Alexandre Oliva <aoliva@redhat.com>
+ 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.
+
+2008-12-10 Alexandre Oliva <aoliva@redhat.com>
+
PR middle-end/38271
* tree-sra.c (sra_build_bf_assignment): Avoid warnings for
variables initialized from SRAed bit fields.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 68d0ee8da3b..669948bc7ce 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -110,6 +110,9 @@ static void dwarf2out_source_line (unsigned int, const char *);
#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) (REGNO)
#endif
+/* Save the result of dwarf2out_do_frame across PCH. */
+static GTY(()) bool saved_do_cfi_asm = 0;
+
/* Decide whether we want to emit frame unwind information for the current
translation unit. */
@@ -121,7 +124,7 @@ dwarf2out_do_frame (void)
we're not going to output frame or unwind info. */
return (write_symbols == DWARF2_DEBUG
|| write_symbols == VMS_AND_DWARF2_DEBUG
- || DWARF2_FRAME_INFO
+ || DWARF2_FRAME_INFO || saved_do_cfi_asm
#ifdef DWARF2_UNWIND_INFO
|| (DWARF2_UNWIND_INFO
&& (flag_unwind_tables
@@ -142,7 +145,7 @@ dwarf2out_do_cfi_asm (void)
#endif
if (!flag_dwarf2_cfi_asm || !dwarf2out_do_frame ())
return false;
- if (!eh_personality_libfunc)
+ if (saved_do_cfi_asm || !eh_personality_libfunc)
return true;
if (!HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
return false;
@@ -156,6 +159,7 @@ dwarf2out_do_cfi_asm (void)
if ((enc & 0x70) != 0 && (enc & 0x70) != DW_EH_PE_pcrel)
return false;
+ saved_do_cfi_asm = true;
return true;
}
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 9f6148edc13..a6378bc339c 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-10 Alexandre Oliva <aoliva@redhat.com>
+
+ PR target/37033
+ * pch.c (cpp_valid_state): Improve message for poisoned symbols.
+ Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
+
2008-11-29 Joseph Myers <joseph@codesourcery.com>
* lex.c (cpp_token_len): Use 6 as default length.
diff --git a/libcpp/pch.c b/libcpp/pch.c
index bf7b9bea36d..f459d2cb906 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;