This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor
- From: ccoutant at google dot com (Cary Coutant)
- To: gcc-patches at gcc dot gnu dot org, saugustine at google dot com
- Date: Fri, 17 Aug 2012 15:09:51 -0700 (PDT)
- Subject: [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor
This patch is for the google/gcc-4_7 branch. I'll submit it for trunk
after the Fission patches have gone in.
When adding names to the pubnames table (-gsplit-dwarf or -gpubnames),
a method within a union may not get handled properly, sometimes resulting
in an internal compiler error in output_pubnames().
This patch fixes the problem by using the existing predicate,
class_scope_p, instead of is_class_die, which failed to test for
a union type.
2012-08-17 Cary Coutant <ccoutant@google.com>
gcc/
* dwarf2out.c (is_class_die): Remove function.
(add_pubname): Call class_scope_p instead.
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 190490)
+++ gcc/dwarf2out.c (working copy)
@@ -7035,15 +7035,6 @@ is_namespace_die (dw_die_ref c)
return c && c->die_tag == DW_TAG_namespace;
}
-/* Returns true iff C is a class or structure DIE. */
-
-static inline bool
-is_class_die (dw_die_ref c)
-{
- return c && (c->die_tag == DW_TAG_class_type
- || c->die_tag == DW_TAG_structure_type);
-}
-
static char *
gen_internal_sym (const char *prefix)
{
@@ -9314,7 +9305,7 @@ add_pubname (tree decl, dw_die_ref die)
class_member, it will either be inside the class already, or will have just
looked up the class to find the member. Either way, searching the class is
faster than searching the index. */
- if ((TREE_PUBLIC (decl) && !is_class_die (die->die_parent))
+ if ((TREE_PUBLIC (decl) && !class_scope_p (die->die_parent))
|| is_cu_die (die->die_parent) || is_namespace_die (die->die_parent))
{
const char *name = dwarf2_name (decl, 1);