diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-22 08:22:52 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-22 08:22:52 +0000 |
commit | af2a449c52fdb82302fedeb42d380afc08bd9ac8 (patch) | |
tree | 7469da4a5aa75fe9e17224ad66d315aa58c26db1 | |
parent | c2c14056b4adb95d24b71dd018876b4d7e23a16e (diff) | |
download | gcc-af2a449c52fdb82302fedeb42d380afc08bd9ac8.tar.gz |
PR target/37170
* final.c (mark_symbol_refs_as_used): New function.
* output.h (mark_symbol_refs_as_used): New prototype.
* config/s390/s390.c (s390_mark_symbol_ref_as_used): Removed.
(s390_output_pool_entry): Use mark_symbol_refs_as_used.
* config/arm/arm.md (consttable_4): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142113 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/config/arm/arm.md | 1 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 21 | ||||
-rw-r--r-- | gcc/final.c | 13 | ||||
-rw-r--r-- | gcc/output.h | 5 |
4 files changed, 17 insertions, 23 deletions
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 071f622d08c..b60ba831d15 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -10836,6 +10836,7 @@ } default: assemble_integer (operands[0], 4, BITS_PER_WORD, 1); + mark_symbol_refs_as_used (operands[0]); break; } return \"\"; diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3f21cd5a072..b6c2089f0ba 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6664,25 +6664,6 @@ s390_chunkify_cancel (struct constant_pool *pool_list) } } -/* Helper rtx-iteration-function for s390_output_pool_entry. Marks - SYMBOL_REFs as referenced through use of assemble_external. */ - -static int -s390_mark_symbol_ref_as_used (rtx *x, void *dummy ATTRIBUTE_UNUSED) -{ - /* If we have a used symbol, we may have to emit assembly - annotations corresponding to whether the symbol is external, weak - or has non-default visibility. */ - if (GET_CODE (*x) == SYMBOL_REF) - { - tree t = SYMBOL_REF_DECL (*x); - if (t) - assemble_external (t); - return -1; - } - return 0; -} - /* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */ void @@ -6702,7 +6683,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) case MODE_INT: assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); - for_each_rtx (&exp, s390_mark_symbol_ref_as_used, NULL); + mark_symbol_refs_as_used (exp); break; default: diff --git a/gcc/final.c b/gcc/final.c index d00790797dd..aceeb7cfb13 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3349,8 +3349,9 @@ output_asm_label (rtx x) assemble_name (asm_out_file, buf); } -/* Helper rtx-iteration-function for output_operand. Marks - SYMBOL_REFs as referenced through use of assemble_external. */ +/* Helper rtx-iteration-function for mark_symbol_refs_as_used and + output_operand. Marks SYMBOL_REFs as referenced through use of + assemble_external. */ static int mark_symbol_ref_as_used (rtx *xp, void *dummy ATTRIBUTE_UNUSED) @@ -3374,6 +3375,14 @@ mark_symbol_ref_as_used (rtx *xp, void *dummy ATTRIBUTE_UNUSED) return 0; } +/* Marks SYMBOL_REFs in x as referenced through use of assemble_external. */ + +void +mark_symbol_refs_as_used (rtx x) +{ + for_each_rtx (&x, mark_symbol_ref_as_used, NULL); +} + /* Print operand X using machine-dependent assembler syntax. The macro PRINT_OPERAND is defined just to control this function. CODE is a non-digit that preceded the operand-number in the % spec, diff --git a/gcc/output.h b/gcc/output.h index 51adcd22648..79b628fd338 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -1,7 +1,7 @@ /* Declarations for insn-output.c. These functions are defined in recog.c, final.c, and varasm.c. Copyright (C) 1987, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GCC. @@ -97,6 +97,9 @@ extern int label_to_alignment (rtx); /* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */ extern void output_asm_label (rtx); +/* Marks SYMBOL_REFs in x as referenced through use of assemble_external. */ +extern void mark_symbol_refs_as_used (rtx); + /* Print a memory reference operand for address X using machine-dependent assembler syntax. */ extern void output_address (rtx); |