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]

[patch] Allocate identifier node for user-specified assembler names


In debugging the problems associated with Bug c++/19797, I found that
we fail to create an identifier node for the real, unstarred, name of
a user-specified assembler name.  As a result, a call to assemble_name
doesn't mark the real name as referenced.  The HP linker is very picky
in requiring that all external functions be imported (typed).  We need
all external references marked when used to fix the above PR correctly.

I'm not quite sure if this is the best place to create the identifier
node but it's where the node for the starred name is created.

Tested on i686-pc-linux-gnu, hppa2.0w-hp-hpux11.11, hppa64-hp-hpux11.11
and hppa-unknown-linux-gnu with no regressions.

Ok for 4.0 and 4.1 branches?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2005-02-26  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* varasm.c (set_user_assembler_name): Add call to get_identifier.

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.477
diff -u -3 -p -r1.477 varasm.c
--- varasm.c	30 Jan 2005 18:27:23 -0000	1.477
+++ varasm.c	26 Feb 2005 18:47:21 -0000
@@ -777,6 +777,7 @@ set_user_assembler_name (tree decl, cons
   char *starred = alloca (strlen (name) + 2);
   starred[0] = '*';
   strcpy (starred + 1, name);
+  get_identifier (name);
   change_decl_assembler_name (decl, get_identifier (starred));
   SET_DECL_RTL (decl, NULL_RTX);
 }


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