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]
Other format: [Raw text]

[PATCH] [Darwin] Fix some compiling compat testcases


The problem on Darwin is that the size passed to .comm cannot be 
zero, otherwise the symbol does not get declared.  This patch
makes sure that the size is never zero.

OK? Bootstrapped on powerpc-apple-darwin with no regression and some
more testcases starting to work.



ChangeLog:
        * darwin.h (ASM_OUTPUT_COMMON): Make sure we do not have a
        size of 0.



Index: darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.52
diff -c -3 -p -r1.52 darwin.h
*** darwin.h    9 Apr 2004 19:57:46 -0000       1.52
--- darwin.h    18 Jun 2004 05:40:03 -0000
*************** do {                                                                    \
*** 203,213 ****
     symbol.  */
  /* ? */
  #undef  ASM_OUTPUT_ALIGNED_COMMON
! #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
!   do { fputs (".comm ", (FILE));                      \
!        RS6000_OUTPUT_BASENAME ((FILE), (NAME));               \
!        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
!               (SIZE)); } while (0)
  
  /* Override the standard rs6000 definition.  */
  
--- 203,216 ----
     symbol.  */
  /* ? */
  #undef  ASM_OUTPUT_ALIGNED_COMMON
! #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)                  \
!   do {                                                                        \
!     unsigned HOST_WIDE_INT size = SIZE;                                       \
!     fputs (".comm ", (FILE));                                         \
!     RS6000_OUTPUT_BASENAME ((FILE), (NAME));                          \
!     if (size == 0) size = 1;                                          \
!     fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);      \
!   } while (0)
  
  /* Override the standard rs6000 definition.  */
  


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