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
This commit is contained in:
Eric Botcazou 2004-05-07 08:58:00 +02:00 committed by Eric Botcazou
parent 3c4392aa5f
commit 92ff0c419a
4 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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>
* optabs.h (enum optab_index): Add new OTI_log1p.

View File

@ -377,7 +377,8 @@ handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED)
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)

View File

@ -1,3 +1,7 @@
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>
* gcc.dg/i386-387-1.c: Add new test for __builtin_fmod.

View File

@ -0,0 +1,25 @@
/* 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();
}