This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH] Robustify C++ classify_record langhook (PR debug/34535)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]