This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

varasm patch breaks sh-coff


This patch:


Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -p -r1.132 -r1.133
*** varasm.c	2000/08/30 22:50:51	1.132
--- varasm.c	2000/09/11 05:44:50	1.133
*************** make_decl_rtl (decl, asmspec, top_level)
*** 710,717 ****
  
    reg_number = decode_reg_name (asmspec);
    if (reg_number == -2)
!     /* ASMSPEC is given, and not the name of a register.  */
!     new_name = asmspec;
  
    if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
      {
--- 710,723 ----
  
    reg_number = decode_reg_name (asmspec);
    if (reg_number == -2)
!     {
!       /* ASMSPEC is given, and not the name of a register.  Mark the
! 	 name with a star so assemble_name won't munge it.  */
!       char *starred = alloca (strlen (asmspec) + 2);
!       starred[0] = '*';
!       strcpy (starred + 1, asmspec);
!       new_name = starred;
!     }
  
    if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
      {


breaks sh-coff.  In libgcc1-test.c, there is:


extern void __start() __asm__("__start");

/* Provide functions that might be needed by soft-float emulation routines.  */
void *memcpy(void *to,
             const void *from __attribute__((__unused__)),
             size_t len __attribute__((__unused__)))
{
  return to;
}

void start() {}


Your patch causes "*start" to be used for the identifier.
In sdbout.c:sdbout_symbol, the '*' is not stripped:


    case FUNCTION_DECL:
      /* Don't mention a nested function under its parent.  */
      context = decl_function_context (decl);
      if (context == current_function_decl)
        return;
      /* Check DECL_INITIAL to distinguish declarations from definitions.
         Don't output debug info here for declarations; they will have
         a DECL_INITIAL value of 0.  */
      if (! DECL_INITIAL (decl))
        return;
      if (GET_CODE (DECL_RTL (decl)) != MEM
          || GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
        return;
      PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
      PUT_SDB_VAL (XEXP (DECL_RTL (decl), 0));
      PUT_SDB_SCL (TREE_PUBLIC (decl) ? C_EXT : C_STAT);
      break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]