+2000-11-14 Jakub Jelinek <jakub@redhat.com>
+
+ * varasm.c (struct varasm_status): Change x_const_rtx_sym_hash_table
+ to array of pool_constnat pointers.
+ (struct pool_constant): Add next_sym and label members.
+ (struct pool_sym): Remove.
+ (init_varasm_status): Change pool_sym into pool_constant.
+ (mark_pool_constant): Mark pc->label string as well.
+ (mark_pool_sym_hash_table): Remove.
+ (mark_varasm_status): Remove it from caller as well.
+ (free_varasm_status): Don't free pool_sym structures.
+ (force_const_mem): Don't allocate pool_sym structure, instead
+ fill pool->label and chain it into rtx_sym hash table.
+ (find_pool_constant, mark_constant_pool): Use pool_constant instead
+ of pool_sym.
+
2000-11-14 Jakub Jelinek <jakub@redhat.com>
* reload1.c (emit_input_reload_insns): Honour forcing of constants
so each function gets its own constants-pool that comes right before
it. */
struct constant_descriptor **x_const_rtx_hash_table;
- struct pool_sym **x_const_rtx_sym_hash_table;
+ struct pool_constant **x_const_rtx_sym_hash_table;
/* Pointers to first and last constant in pool. */
struct pool_constant *x_first_pool, *x_last_pool;
#endif
#endif /* BSS_SECTION_ASM_OP */
static void mark_pool_constant PARAMS ((struct pool_constant *));
-static void mark_pool_sym_hash_table PARAMS ((struct pool_sym **));
static void mark_const_hash_entry PARAMS ((void *));
static void asm_emit_uninitialised PARAMS ((tree, const char*, int, int));
\f
struct pool_constant
{
struct constant_descriptor *desc;
- struct pool_constant *next;
- enum machine_mode mode;
+ struct pool_constant *next, *next_sym;
+ char *label;
rtx constant;
+ enum machine_mode mode;
int labelno;
int align;
int offset;
int mark;
};
-/* Structure used to maintain hash table mapping symbols used to their
- corresponding constants. */
-
-struct pool_sym
-{
- char *label;
- struct pool_constant *pool;
- struct pool_sym *next;
-};
-
/* Hash code for a SYMBOL_REF with CONSTANT_POOL_ADDRESS_P true.
The argument is XSTR (... , 0) */
= ((struct constant_descriptor **)
xcalloc (MAX_RTX_HASH_TABLE, sizeof (struct constant_descriptor *)));
p->x_const_rtx_sym_hash_table
- = ((struct pool_sym **)
- xcalloc (MAX_RTX_HASH_TABLE, sizeof (struct pool_sym *)));
+ = ((struct pool_constant **)
+ xcalloc (MAX_RTX_HASH_TABLE, sizeof (struct pool_constant *)));
p->x_first_pool = p->x_last_pool = 0;
p->x_pool_offset = 0;
{
ggc_mark (pc);
ggc_mark_rtx (pc->constant);
+ ggc_mark_string (pc->label);
pc = pc->next;
}
}
-/* Mark PPS for GC. */
-
-static void
-mark_pool_sym_hash_table (pps)
- struct pool_sym **pps;
-{
- struct pool_sym *ps;
- int i;
-
- for (i = 0; i < MAX_RTX_HASH_TABLE; ++i)
- for (ps = pps[i]; ps ; ps = ps->next)
- ggc_mark_string (ps->label);
-}
-
/* Mark P for GC. */
void
return;
mark_pool_constant (p->x_first_pool);
- mark_pool_sym_hash_table (p->x_const_rtx_sym_hash_table);
ggc_mark_rtx (p->x_const_double_chain);
}
for (i = 0; i < MAX_RTX_HASH_TABLE; ++i)
{
struct constant_descriptor* cd;
- struct pool_sym *ps;
cd = p->x_const_rtx_hash_table[i];
while (cd) {
free (cd);
cd = next;
}
-
- ps = p->x_const_rtx_sym_hash_table[i];
- while (ps) {
- struct pool_sym *next = ps->next;
- free (ps);
- ps = next;
- }
}
free (p->x_const_rtx_hash_table);
if (found == 0)
{
register struct pool_constant *pool;
- register struct pool_sym *sym;
int align;
/* No constant equal to X is known to have been output.
/* Add label to symbol hash table. */
hash = SYMHASH (found);
- sym = (struct pool_sym *) xmalloc (sizeof (struct pool_sym));
- sym->label = found;
- sym->pool = pool;
- sym->next = const_rtx_sym_hash_table[hash];
- const_rtx_sym_hash_table[hash] = sym;
+ pool->label = found;
+ pool->next_sym = const_rtx_sym_hash_table[hash];
+ const_rtx_sym_hash_table[hash] = pool;
}
/* We have a symbol name; construct the SYMBOL_REF and the MEM. */
struct function *f;
rtx addr;
{
- struct pool_sym *sym;
+ struct pool_constant *pool;
const char *label = XSTR (addr, 0);
- for (sym = f->varasm->x_const_rtx_sym_hash_table[SYMHASH (label)]; sym;
- sym = sym->next)
- if (sym->label == label)
- return sym->pool;
+ for (pool = f->varasm->x_const_rtx_sym_hash_table[SYMHASH (label)]; pool;
+ pool = pool->next_sym)
+ if (pool->label == label)
+ return pool;
abort ();
}
not clear that 2'd level references can happen. */
for (pool = first_pool; pool; pool = pool->next)
{
- struct pool_sym *sym;
+ struct pool_constant *tem;
const char *label;
/* skip unmarked entries; no insn refers to them. */
label = XSTR (pool->constant, 0);
/* Be sure the symbol's value is marked. */
- for (sym = const_rtx_sym_hash_table[SYMHASH (label)]; sym;
- sym = sym->next)
- if (sym->label == label)
- sym->pool->mark = 1;
+ for (tem = const_rtx_sym_hash_table[SYMHASH (label)]; tem;
+ tem = tem->next)
+ if (tem->label == label)
+ tem->mark = 1;
/* If we didn't find it, there's something truly wrong here, but it
will be announced by the assembler. */
}