This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/14962
> Perhaps better just as FUNCTION_DECL || VAR_DECL; the other two
> don't have externally visible names.
Here's the revised version. Bootstrapped/regtested on sparc-sun-solaris2.8.
OK for mainline and 3.4 branch?
2004-05-06 Eric Botcazou <ebotcazou@libertysurf.fr>
PR c++/14962
* c-pragma.c (handle_pragma_redefine_extname): Only change
the assembler name of FUNCTION_DECLs and VAR_DECLs.
--
Eric Botcazou
Index: c-pragma.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pragma.c,v
retrieving revision 1.66.2.1
diff -u -p -r1.66.2.1 c-pragma.c
--- c-pragma.c 23 Jan 2004 23:35:53 -0000 1.66.2.1
+++ c-pragma.c 6 May 2004 08:11:02 -0000
@@ -377,7 +377,8 @@ handle_pragma_redefine_extname (cpp_read
warning ("junk at end of #pragma redefine_extname");
decl = identifier_global_value (oldname);
- if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ if (decl && (TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == VAR_DECL))
{
if (DECL_ASSEMBLER_NAME_SET_P (decl)
&& DECL_ASSEMBLER_NAME (decl) != newname)