Patchwork Fix PR53471, remove DECL_ASSEMBLER_NAME deferred compute

login
register
mail settings
Submitter Richard Guenther
Date June 4, 2012, 10:21 a.m.
Message ID <Pine.LNX.4.64.1206041220300.5860@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/162707/
State New
Headers show

Comments

Richard Guenther - June 4, 2012, 10:21 a.m.
On Mon, 4 Jun 2012, Richard Guenther wrote:

> On Fri, 1 Jun 2012, Jason Merrill wrote:
> 
> > Or use your first patch, and decide that we don't care about the linkage name
> > of unreachable types.  What types are affected by this, anyway?

So like the following.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

Thanks,
Richard.

2012-06-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53471
	* dwarf2out.c (dwarf2out_finish): If generating LTO do not
	create new assembler names.
Jason Merrill - June 4, 2012, 1:09 p.m.
Please add a comment explaining why flag_generate_lto matters there.  OK 
with that change.

Jason
Richard Guenther - June 4, 2012, 1:17 p.m.
On Mon, 4 Jun 2012, Jason Merrill wrote:

> Please add a comment explaining why flag_generate_lto matters there.  OK with
> that change.

Committed as follows.

Thanks,
Richard.

2012-06-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53471
	* dwarf2out.c (dwarf2out_finish): If generating LTO do not
	create new assembler names.

Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c	(revision 188176)
--- gcc/dwarf2out.c	(working copy)
*************** dwarf2out_finish (const char *filename)
*** 22158,22164 ****
    for (node = deferred_asm_name; node; node = node->next)
      {
        tree decl = node->created_for;
!       if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
  	{
  	  add_linkage_attr (node->die, decl);
  	  move_linkage_attr (node->die);
--- 22158,22168 ----
    for (node = deferred_asm_name; node; node = node->next)
      {
        tree decl = node->created_for;
!       /* When generating LTO bytecode we can not generate new assembler
!          names at this point and all important decls got theirs via
! 	 free-lang-data.  */
!       if ((!flag_generate_lto || DECL_ASSEMBLER_NAME_SET_P (decl))
! 	  && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
  	{
  	  add_linkage_attr (node->die, decl);
  	  move_linkage_attr (node->die);

Patch

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 188168)
+++ gcc/dwarf2out.c	(working copy)
@@ -22158,7 +22158,8 @@  dwarf2out_finish (const char *filename)
   for (node = deferred_asm_name; node; node = node->next)
     {
       tree decl = node->created_for;
-      if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
+      if ((!flag_generate_lto || DECL_ASSEMBLER_NAME_SET_P (decl))
+	  && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
 	{
 	  add_linkage_attr (node->die, decl);
 	  move_linkage_attr (node->die);