diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-27 01:48:11 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-27 01:48:11 +0000 |
commit | 7edf3a2b436934a4d12c0118b38a69963eb4d1ba (patch) | |
tree | b7681d01248c778248685f3ec5dfb7509c7adecf /gcc/varasm.c | |
parent | 367062902bc6b2346920bde413fc418fc2fbbc30 (diff) | |
download | gcc-7edf3a2b436934a4d12c0118b38a69963eb4d1ba.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69842 138bc75d-0d04-0410-961f-82ee72b054a4
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 a8ff36fb0dc..c9dae8954b7 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 |