public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* varasm patch breaks sh-coff
@ 2000-09-11 11:07 Joern Rennecke
  2000-09-11 11:25 ` Zack Weinberg
  0 siblings, 1 reply; 4+ messages in thread
From: Joern Rennecke @ 2000-09-11 11:07 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-09-11 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-11 11:07 varasm patch breaks sh-coff Joern Rennecke
2000-09-11 11:25 ` Zack Weinberg
2000-09-11 11:52   ` sdbout.c patch to use assemble_name (Was: Re: varasm patch breaks sh-coff) Joern Rennecke
2000-09-11 15:12     ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).