Commit a7fe25b8 by Jakub Jelinek

re PR target/37170 (gcc.dg/weak/weak-1.c)

	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.

From-SVN: r142113
parent 3b139014
...@@ -10836,6 +10836,7 @@ ...@@ -10836,6 +10836,7 @@
} }
default: default:
assemble_integer (operands[0], 4, BITS_PER_WORD, 1); assemble_integer (operands[0], 4, BITS_PER_WORD, 1);
mark_symbol_refs_as_used (operands[0]);
break; break;
} }
return \"\"; return \"\";
......
...@@ -6664,25 +6664,6 @@ s390_chunkify_cancel (struct constant_pool *pool_list) ...@@ -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. */ /* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */
void void
...@@ -6702,7 +6683,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) ...@@ -6702,7 +6683,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align)
case MODE_INT: case MODE_INT:
assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); 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; break;
default: default:
......
...@@ -3349,8 +3349,9 @@ output_asm_label (rtx x) ...@@ -3349,8 +3349,9 @@ output_asm_label (rtx x)
assemble_name (asm_out_file, buf); assemble_name (asm_out_file, buf);
} }
/* Helper rtx-iteration-function for output_operand. Marks /* Helper rtx-iteration-function for mark_symbol_refs_as_used and
SYMBOL_REFs as referenced through use of assemble_external. */ output_operand. Marks SYMBOL_REFs as referenced through use of
assemble_external. */
static int static int
mark_symbol_ref_as_used (rtx *xp, void *dummy ATTRIBUTE_UNUSED) 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) ...@@ -3374,6 +3375,14 @@ mark_symbol_ref_as_used (rtx *xp, void *dummy ATTRIBUTE_UNUSED)
return 0; 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. /* Print operand X using machine-dependent assembler syntax.
The macro PRINT_OPERAND is defined just to control this function. The macro PRINT_OPERAND is defined just to control this function.
CODE is a non-digit that preceded the operand-number in the % spec, CODE is a non-digit that preceded the operand-number in the % spec,
......
/* Declarations for insn-output.c. These functions are defined in recog.c, /* Declarations for insn-output.c. These functions are defined in recog.c,
final.c, and varasm.c. final.c, and varasm.c.
Copyright (C) 1987, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 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. This file is part of GCC.
...@@ -97,6 +97,9 @@ extern int label_to_alignment (rtx); ...@@ -97,6 +97,9 @@ extern int label_to_alignment (rtx);
/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */ /* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
extern void output_asm_label (rtx); 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 /* Print a memory reference operand for address X
using machine-dependent assembler syntax. */ using machine-dependent assembler syntax. */
extern void output_address (rtx); extern void output_address (rtx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment