pro64-support
[Top] [All Lists]

Re: gcc extension to control variable names works with sgiCC, but not s

To: Chandrasekhar Murthy <murthy@xxxxxxx>
Subject: Re: gcc extension to control variable names works with sgiCC, but not sgicc.
From: David Goodwin <goodwin@xxxxxxxxxxxxx>
Date: Fri, 5 Jan 2001 10:52:56 -0800 (PST)
Cc: goodwin@xxxxxxxxxxxxx, pro64-support@xxxxxxxxxxx
In-reply-to: <3A560BFA.5DF2AFFD@xxxxxxx>
References: <14934.1634.87891.229902@xxxxxxxxxxxxxxxxxxxxxx> <3A560BFA.5DF2AFFD@xxxxxxx>
Reply-to: goodwin@xxxxxxxxxxxxx
Sender: owner-pro64-support@xxxxxxxxxxx
Yes, that seems to work. Here's the patch:

==== gccfe/tree_symtab.cxx ====
***************
*** 554,561 ****
    if (TREE_CODE(decl_node) == ERROR_MARK)
      exit (RC_USER_ERROR);
  
!   if (DECL_NAME (decl_node))
!     name = IDENTIFIER_POINTER (DECL_NAME (decl_node));
    else {
      DevWarn ("no name for DECL_NODE");
      name = "__unknown__";
--- 554,561 ----
    if (TREE_CODE(decl_node) == ERROR_MARK)
      exit (RC_USER_ERROR);
  
!   if (DECL_ASSEMBLER_NAME (decl_node))
!     name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl_node));
    else {
      DevWarn ("no name for DECL_NODE");
      name = "__unknown__";



Chandrasekhar Murthy writes:
 > David Goodwin wrote:
 > > 
 > > gcc allows this use of "asm" to set the name used for a variable in the
 > > assembly file to be different than the variable name in the source:
 > > 
 > > char myarray[10] asm ("asmname_myarray");
 > > char *
 > > proc (void)
 > > {
 > >   return myarray;
 > > }
 > > 
 > > > sgicc -v
 > > SGIcc Compilers: Version 0.01.0-12
 > > > sgiCC -v
 > > SGIcc Compilers: Version 0.01.0-12
 > > 
 > > Compiling with sgiCC gives the correct result, i.e. the array is referred
 > > to as "asmname_myarray". Using sgicc, the array is incorrectly referred to
 > > as "myarray".
 > 
 > sgicc is using DECL_NAME instead of DECL_ASSEMBLER_NAME in
 > tree_symtab.cxx.
 > 
 > I think this should fix the problem.
 > 
 > Murthy

<Prev in Thread] Current Thread [Next in Thread>