diff options
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 8b321af8296..6d71d056636 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; |