aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 8b321af8296..a7c84cd3ed7 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,6 +1,6 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1586,6 +1586,8 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node
|| (flag_zero_initialized_in_bss
+ /* Leave constant zeroes in .rodata so they can be shared. */
+ && !TREE_READONLY (decl)
&& initializer_zerop (DECL_INITIAL (decl))))
{
unsigned HOST_WIDE_INT size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
@@ -2148,7 +2150,11 @@ struct rtx_const GTY(())
ENUM_BITFIELD(machine_mode) mode : 16;
union rtx_const_un {
REAL_VALUE_TYPE du;
- struct addr_const GTY ((tag ("1"))) addr;
+ struct rtx_const_u_addr {
+ rtx base;
+ const char *symbol;
+ HOST_WIDE_INT offset;
+ } GTY ((tag ("1"))) addr;
struct rtx_const_u_di {
HOST_WIDE_INT high;
HOST_WIDE_INT low;
@@ -2859,9 +2865,6 @@ struct constant_descriptor_rtx GTY(())
/* More constant_descriptors with the same hash code. */
struct constant_descriptor_rtx *next;
- /* The label of the constant. */
- const char *label;
-
/* A MEM for the constant. */
rtx rtl;
@@ -3081,13 +3084,12 @@ decode_rtx_const (mode, x, value)
if (value->kind >= RTX_INT && value->un.addr.base != 0)
switch (GET_CODE (value->un.addr.base))
{
-#if 0
case SYMBOL_REF:
/* Use the string's address, not the SYMBOL_REF's address,
for the sake of addresses of library routines. */
- value->un.addr.base = (rtx) XSTR (value->un.addr.base, 0);
+ value->un.addr.symbol = XSTR (value->un.addr.base, 0);
+ value->un.addr.base = NULL_RTX;
break;
-#endif
case LABEL_REF:
/* For a LABEL_REF, compare labels. */
@@ -3112,7 +3114,8 @@ simplify_subtraction (x)
if (val0.kind >= RTX_INT
&& val0.kind == val1.kind
- && val0.un.addr.base == val1.un.addr.base)
+ && val0.un.addr.base == val1.un.addr.base
+ && val0.un.addr.symbol == val1.un.addr.symbol)
return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
return x;
@@ -4047,6 +4050,23 @@ output_constant (exp, size, align)
thissize = MIN (TREE_STRING_LENGTH (exp), size);
assemble_string (TREE_STRING_POINTER (exp), thissize);
}
+ else if (TREE_CODE (exp) == VECTOR_CST)
+ {
+ int elt_size;
+ tree link;
+ unsigned int nalign;
+ enum machine_mode inner;
+
+ inner = GET_MODE_INNER (TYPE_MODE (TREE_TYPE (exp)));
+ nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
+
+ elt_size = GET_MODE_UNIT_SIZE (TYPE_MODE (TREE_TYPE (exp)));
+
+ link = TREE_VECTOR_CST_ELTS (exp);
+ output_constant (TREE_VALUE (link), elt_size, align);
+ while ((link = TREE_CHAIN (link)) != NULL)
+ output_constant (TREE_VALUE (link), elt_size, nalign);
+ }
else
abort ();
break;
@@ -4660,12 +4680,13 @@ default_assemble_visibility (decl, vis)
const char *name, *type;
- name = (* targetm.strip_name_encoding)
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
+ name = (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
type = visibility_types[vis];
#ifdef HAVE_GAS_HIDDEN
- fprintf (asm_out_file, "\t.%s\t%s\n", type, name);
+ fprintf (asm_out_file, "\t.%s\t", type);
+ assemble_name (asm_out_file, name);
+ fprintf (asm_out_file, "\n");
#else
warning ("visibility attribute not supported in this configuration; ignored");
#endif