/* 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.
/* Number for making the label on the next
constant that is stored in memory. */
-int const_labelno;
+static GTY(()) int const_labelno;
/* Number for making the label on the next
static variable internal to a function. */
-int var_labelno;
+static GTY(()) int var_labelno;
/* Carry information from ASM_DECLARE_OBJECT_NAME
to ASM_FINISH_DECLARE_OBJECT. */
#endif
#ifdef BSS_SECTION_ASM_OP
#ifdef ASM_OUTPUT_ALIGNED_BSS
-static void asm_output_aligned_bss PARAMS ((FILE *, tree, const char *,
- int, int));
+static void asm_output_aligned_bss
+ PARAMS ((FILE *, tree, const char *, int, int)) ATTRIBUTE_UNUSED;
#endif
#endif /* BSS_SECTION_ASM_OP */
static hashval_t const_str_htab_hash PARAMS ((const void *x));
static void resolve_unique_section PARAMS ((tree, int, int));
static void mark_weak PARAMS ((tree));
\f
-static enum in_section { no_section, in_text, in_data, in_named
+enum in_section { no_section, in_text, in_data, in_named
#ifdef BSS_SECTION_ASM_OP
, in_bss
#endif
#ifdef EXTRA_SECTIONS
, EXTRA_SECTIONS
#endif
-} in_section = no_section;
+};
+static GTY(()) enum in_section in_section = no_section;
/* Return a nonzero value if DECL has a section attribute. */
#ifndef IN_NAMED_SECTION
#endif
/* Text of section name when in_section == in_named. */
-static const char *in_named_name;
+static GTY(()) const char *in_named_name;
/* Hash table of flags that have been used for a particular named section. */
-struct in_named_entry
+struct in_named_entry GTY(())
{
const char *name;
unsigned int flags;
bool declared;
};
-static htab_t in_named_htab;
+static GTY((param_is (struct in_named_entry))) htab_t in_named_htab;
/* Define functions like text_section for any extra sections. */
#ifdef EXTRA_SECTION_FUNCTIONS
if (!entry)
{
- entry = (struct in_named_entry *) xmalloc (sizeof (*entry));
+ entry = (struct in_named_entry *) ggc_alloc (sizeof (*entry));
*slot = entry;
entry->name = ggc_strdup (section);
entry->flags = flags;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
}
- /* If this variable is to be treated as volatile, show its
- tree node has side effects. */
- if ((flag_volatile_global && TREE_CODE (decl) == VAR_DECL
- && TREE_PUBLIC (decl))
- || ((flag_volatile_static && TREE_CODE (decl) == VAR_DECL
- && (TREE_PUBLIC (decl) || TREE_STATIC (decl)))))
- TREE_SIDE_EFFECTS (decl) = 1;
-
x = gen_rtx_MEM (DECL_MODE (decl), gen_rtx_SYMBOL_REF (Pmode, name));
SYMBOL_REF_WEAK (XEXP (x, 0)) = DECL_WEAK (decl);
if (TREE_CODE (decl) != FUNCTION_DECL)
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);
ENUM_BITFIELD(kind) kind : 16;
ENUM_BITFIELD(machine_mode) mode : 16;
union rtx_const_un {
- REAL_VALUE_TYPE du;
- struct addr_const GTY ((tag ("1"))) addr;
+ REAL_VALUE_TYPE GTY ((tag ("4"))) du;
+ 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;
/* 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;
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. */
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;
op1 = TREE_OPERAND (value, 1);
/* Like STRIP_NOPS except allow the operand mode to widen.
- This works around a feature of fold that simplfies
+ This works around a feature of fold that simplifies
(int)(p1 - p2) to ((int)p1 - (int)p2) under the theory
that the narrower operation is cheaper. */
enum tree_code code;
HOST_WIDE_INT thissize;
- /* Some front-ends use constants other than the standard language-indepdent
+ /* Some front-ends use constants other than the standard language-independent
varieties, but which may still be output directly. Give the front-end a
chance to convert EXP to a language-independent representation. */
exp = (*lang_hooks.expand_constant) (exp);
DECL_ONE_ONLY (decl) = 1;
}
else if (SUPPORTS_WEAK)
- DECL_WEAK (decl) = 1;
+ declare_weak (decl);
else
abort ();
}
{
const_str_htab = htab_create_ggc (128, const_str_htab_hash,
const_str_htab_eq, NULL);
- in_named_htab = htab_create (31, in_named_entry_hash,
- in_named_entry_eq, NULL);
+ in_named_htab = htab_create_ggc (31, in_named_entry_hash,
+ in_named_entry_eq, NULL);
const_alias_set = new_alias_set ();
}
}
/* Determine whether or not a pointer mode is valid. Assume defaults
- of ptr_mode or Pmode - can be overriden. */
+ of ptr_mode or Pmode - can be overridden. */
bool
default_valid_pointer_mode (mode)
enum machine_mode mode;