diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-07-27 01:48:11 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-07-27 01:48:11 +0000 |
commit | 18f3e349aa03695bd162d43ac746402aae315096 (patch) | |
tree | b7681d01248c778248685f3ec5dfb7509c7adecf /gcc/varasm.c | |
parent | 404edd110efdb47f40f0f670d25b4e2aa84d2168 (diff) | |
download | gcc-18f3e349aa03695bd162d43ac746402aae315096.zip gcc-18f3e349aa03695bd162d43ac746402aae315096.tar.gz gcc-18f3e349aa03695bd162d43ac746402aae315096.tar.bz2 |
varasm.c (output_constant_def_contents): Use ASM_DECLARE_CONSTANT_NAME if defined.
* varasm.c (output_constant_def_contents): Use
ASM_DECLARE_CONSTANT_NAME if defined.
* doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME.
* config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized
objects get at least one byte to prevent assembler problems.
(ASM_DECLARE_CONSTANT_NAME): New.
Index: testsuite/ChangeLog
* gcc.c-torture/compile/zero-strct-2.c: New test.
From-SVN: r69842
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index a8ff36f..c9dae89 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2547,6 +2547,7 @@ output_constant_def_contents (rtx symbol) { tree exp = SYMBOL_REF_DECL (symbol); const char *label = XSTR (symbol, 0); + HOST_WIDE_INT size; /* Make sure any other constants whose addresses appear in EXP are assigned label numbers. */ @@ -2571,17 +2572,20 @@ output_constant_def_contents (rtx symbol) 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 + ASM_DECLARE_CONSTANT_NAME (asm_out_file, label, exp, size); +#else + /* Standard thing is just output label for the constant. */ ASM_OUTPUT_LABEL (asm_out_file, label); +#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); } /* A constant which was deferred in its original location has been |