diff -uNr gcc-1495.ORIG/gcc/config/darwin.h gcc-1495/gcc/config/darwin.h --- gcc-1495.ORIG/gcc/config/darwin.h Sat Oct 25 07:48:25 2003 +++ gcc-1495/gcc/config/darwin.h Fri Jan 9 17:17:32 2004 @@ -434,6 +434,10 @@ || DECL_INITIAL (DECL)) \ (* targetm.encode_section_info) (DECL, false); \ ASM_OUTPUT_LABEL (FILE, xname); \ + /* Darwin doesn't support zero-size objects, so give them a \ + byte. */ \ + if (tree_low_cst (DECL_SIZE_UNIT (DECL), 1) == 0) \ + assemble_zeros (1); \ } while (0) #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ @@ -452,6 +456,15 @@ || DECL_INITIAL (DECL)) \ (* targetm.encode_section_info) (DECL, false); \ ASM_OUTPUT_LABEL (FILE, xname); \ + } while (0) + +#define ASM_DECLARE_CONSTANT_NAME(FILE, NAME, EXP, SIZE) \ + do { \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + /* Darwin doesn't support zero-size objects, so give them a \ + byte. */ \ + if ((SIZE) == 0) \ + assemble_zeros (1); \ } while (0) /* Wrap new method names in quotes so the assembler doesn't gag. diff -uNr gcc-1495.ORIG/gcc/varasm.c gcc-1495/gcc/varasm.c --- gcc-1495.ORIG/gcc/varasm.c Fri Jan 9 16:45:20 2004 +++ gcc-1495/gcc/varasm.c Fri Jan 9 17:05:32 2004 @@ -2794,6 +2794,8 @@ int after_function = 0; int labelno = -1; rtx rtl; + HOST_WIDE_INT size; + /* We can't just use the saved RTL if this is a deferred string constant and we are not to defer anymore. */ @@ -2958,6 +2960,7 @@ int labelno; { int align; + HOST_WIDE_INT size; /* Align the location counter as required by EXP's data type. */ align = TYPE_ALIGN (TREE_TYPE (exp)); @@ -2975,19 +2978,27 @@ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT)); } - /* Output the label itself. */ + size = int_size_in_bytes (TREE_TYPE (exp)); + if (TREE_CODE (exp) == STRING_CST) + size = MAX (TREE_STRING_LENGTH (exp), size); + + /* Do any machine/system dependent processing of the constant. */ +#ifdef ASM_DECLARE_CONSTANT_NAME + { + char label[256]; + ASM_GENERATE_INTERNAL_LABEL (label, "LC", labelno); + ASM_DECLARE_CONSTANT_NAME (asm_out_file, label, exp, size); + } +#else + /* Standard thing is just output label for the constant. */ + /* APPLE LOCAL begin - 3.4 scheduler update */ (*targetm.asm_out.internal_label) (asm_out_file, "LC", labelno); /* APPLE LOCAL end - 3.4 scheduler update */ +#endif /* ASM_DECLARE_CONSTANT_NAME */ /* Output the value of EXP. */ - output_constant (exp, - (TREE_CODE (exp) == STRING_CST - ? MAX (TREE_STRING_LENGTH (exp), - int_size_in_bytes (TREE_TYPE (exp))) - : int_size_in_bytes (TREE_TYPE (exp))), - align); - + output_constant (exp, size, align); } /* Used in the hash tables to avoid outputting the same constant