aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm.md1
-rw-r--r--gcc/config/s390/s390.c21
-rw-r--r--gcc/final.c13
-rw-r--r--gcc/output.h5
4 files changed, 17 insertions, 23 deletions
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 071f622..b60ba83 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 3f21cd5a..b6c2089 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 d007907..aceeb7c 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 51adcd2..79b628f 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);