Commit 92ff0c41 by Eric Botcazou Committed by Eric Botcazou

re PR c++/14962 (g++ ignores #pragma redefine_extname)

	PR c++/14962
	* c-pragma.c (handle_pragma_redefine_extname): Only change
	the assembler name of FUNCTION_DECLs and VAR_DECLs.

From-SVN: r81610
parent 3c4392aa
2004-05-07 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.
2004-05-07 Uros Bizjak <uros@kss-loka.si> 2004-05-07 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_log1p. * optabs.h (enum optab_index): Add new OTI_log1p.
......
...@@ -377,7 +377,8 @@ handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED) ...@@ -377,7 +377,8 @@ handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED)
warning ("junk at end of #pragma redefine_extname"); warning ("junk at end of #pragma redefine_extname");
decl = identifier_global_value (oldname); 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) if (DECL_ASSEMBLER_NAME_SET_P (decl)
&& DECL_ASSEMBLER_NAME (decl) != newname) && DECL_ASSEMBLER_NAME (decl) != newname)
......
2004-05-07 Eric Botcazou <ebotcazou@libertysurf.fr>
* g++.dg/other/pragma-re-2.C: New test.
2004-05-07 Uros Bizjak <uros@kss-loka.si> 2004-05-07 Uros Bizjak <uros@kss-loka.si>
* gcc.dg/i386-387-1.c: Add new test for __builtin_fmod. * gcc.dg/i386-387-1.c: Add new test for __builtin_fmod.
......
/* PR c++/14962 */
/* Originator: <phil@fsel.com> */
/* { dg-do compile { target *-*-solaris* } } */
/* { dg-final { scan-assembler "new_name" } } */
/* { dg-final { scan-assembler-not "old_name" } } */
#ifndef __PRAGMA_REDEFINE_EXTNAME
#error
#endif
extern "C" {
struct old_name { int i; };
#pragma redefine_extname old_name new_name
int old_name(void);
}
int foo(void)
{
return old_name();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment