public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor
@ 2012-08-17 22:10 Cary Coutant
  2012-08-17 22:19 ` Sterling Augustine
  0 siblings, 1 reply; 3+ messages in thread
From: Cary Coutant @ 2012-08-17 22:10 UTC (permalink / raw)
  To: gcc-patches, saugustine

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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor
  2012-08-17 22:10 [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor Cary Coutant
@ 2012-08-17 22:19 ` Sterling Augustine
  2012-08-17 22:57   ` Cary Coutant
  0 siblings, 1 reply; 3+ messages in thread
From: Sterling Augustine @ 2012-08-17 22:19 UTC (permalink / raw)
  To: Cary Coutant; +Cc: gcc-patches

On Fri, Aug 17, 2012 at 3:09 PM, Cary Coutant <ccoutant@google.com> wrote:
> 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.

OK for Google 4.7

Sterling

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor
  2012-08-17 22:19 ` Sterling Augustine
@ 2012-08-17 22:57   ` Cary Coutant
  0 siblings, 0 replies; 3+ messages in thread
From: Cary Coutant @ 2012-08-17 22:57 UTC (permalink / raw)
  To: Sterling Augustine; +Cc: gcc-patches

> OK for Google 4.7

Thanks, committed at r190494.

-cary

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-17 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 22:10 [google/gcc-4_7] Fix ICE in output_pubnames where union contains a ctor Cary Coutant
2012-08-17 22:19 ` Sterling Augustine
2012-08-17 22:57   ` Cary Coutant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).