This is the mail archive of the gcc-patches@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]

Handle still more oddball cases in Darwin


I committed two changes, to make more C++ programs compile, and
handle a case where memcpy was being called to pass large arguments,
and being referred to explicitly in the same file.  (If anyone asks
for one, I'll write a test case.)  Bootstrapped on powerpc-apple-darwin1.3.

Stan

2001-09-04  Stan Shebs  <shebs@apple.com>

         * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Define.
         * config/darwin.c (machopic_stub_name): Account for internally
         generated lib calls such as memcpy.

Index: darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 darwin.c
*** darwin.c	2001/08/29 02:43:26	1.10
--- darwin.c	2001/09/04 20:44:32
*************** machopic_stub_name (name)
*** 324,337 ****
        const char *name;
   {
     tree temp, ident = get_identifier (name);
!
     for (temp = machopic_stubs;
          temp != NULL_TREE;
          temp = TREE_CHAIN (temp))
       {
         if (ident == TREE_VALUE (temp))
   	return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
!       if (strcmp (name, IDENTIFIER_POINTER (TREE_VALUE (temp))) == 0)
   	return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
       }

--- 324,345 ----
        const char *name;
   {
     tree temp, ident = get_identifier (name);
!   const char *tname;
!
     for (temp = machopic_stubs;
          temp != NULL_TREE;
          temp = TREE_CHAIN (temp))
       {
         if (ident == TREE_VALUE (temp))
   	return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
!       tname = IDENTIFIER_POINTER (TREE_VALUE (temp));
!       if (strcmp (name, tname) == 0)
! 	return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
!       /* A library call name might not be section-encoded yet, so try
! 	 it against a stripped name.  */
!       if (name[0] != '!'
! 	  && tname[0] == '!'
! 	  && strcmp (name, tname + 4) == 0)
   	return IDENTIFIER_POINTER (TREE_PURPOSE (temp));
       }

Index: darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.11
diff -c -3 -p -r1.11 darwin.h
*** darwin.h	2001/08/28 18:37:38	1.11
--- darwin.h	2001/09/04 20:44:46
*************** do { text_section ();							\
*** 215,220 ****
--- 215,236 ----
       ASM_OUTPUT_LABEL (FILE, 
xname);                                     \
     } while (0)

+ #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
+   do {									\
+     char *xname = NAME;                                                 \
+     if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF)             \
+       xname = IDENTIFIER_POINTER (DECL_NAME (DECL));                    \
+     if ((TREE_STATIC (DECL)                                             \
+ 	 && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+         || DECL_INITIAL (DECL))                                         \
+       machopic_define_name (xname);                                     \
+     if ((TREE_STATIC (DECL)                                             \
+ 	 && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+         || DECL_INITIAL (DECL))                                         \
+       ENCODE_SECTION_INFO (DECL);					\
+     ASM_OUTPUT_LABEL (FILE, xname);                                     \
+   } while (0)
+
   /* Wrap new method names in quotes so the assembler doesn't gag.
      Make Objective-C internal symbols local.  */


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