This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Robustify C++ classify_record langhook (PR debug/34535)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Alexandre Oliva <aoliva at redhat dot com>
- Date: Thu, 20 Dec 2007 05:11:53 -0500
- Subject: [C++ PATCH] Robustify C++ classify_record langhook (PR debug/34535)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
A bunch of mudflap C++ tests fail since cp_classify_record langhook
has been added. The problem is that tree-mudflap.c types don't have
TYPE_LANG_SPECIFIC set and as CLASSTYPE_DECLARED_CLASS is a bit
in lang_type_class, cp_classify_record ICEs. While arguably tree-mudflap.c
should be probably changed to make all its stuff DECL_ARTIFICIAL and
DECL_IGNORED_P, a langhook that is passed arbitrary RECORD_TYPEs should
be a little bit more careful.
Fixes all the ICEs during libmudflap make check on x86_64-linux, ok for trunk?
2007-12-20 Jakub Jelinek <jakub@redhat.com>
PR debug/34535
* cp-lang.c (cp_classify_record): Check TYPE_LANG_SPECIFIC
is non-NULL before testing CLASSTYPE_DECLARED_CLASS.
--- gcc/cp/cp-lang.c.jj 2007-12-16 12:36:16.000000000 +0100
+++ gcc/cp/cp-lang.c 2007-12-20 10:58:19.000000000 +0100
@@ -159,7 +159,7 @@ cxx_dwarf_name (tree t, int verbosity)
static enum classify_record
cp_classify_record (tree type)
{
- if (CLASSTYPE_DECLARED_CLASS (type))
+ if (TYPE_LANG_SPECIFIC (type) && CLASSTYPE_DECLARED_CLASS (type))
return RECORD_IS_CLASS;
return RECORD_IS_STRUCT;
Jakub