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
|