Commit b20cbca2 by Zack Weinberg Committed by Zack Weinberg

* varasm.c (struct deferred_constant, defer_addressed_constants_flag)

	(defer_addressed_constants, output_deferred_addressed_constants): Kill.
	(output_constant_def): Remove code predicated on
	defer_addressed_constants_flag.

	* output.h: Remove prototypes of deleted functions.
	* c-typeck.c (constructor_subconstants_deferred): Kill.
	(struct initializer_stack): Remove 'deferred' field.
	(start_init): Remove all references to the above.
	(finish_init): Likewise. Also remove never-executed call to
	output_deferred_addressed_constants.  Pull assignment to
	defstr out of if expression.

From-SVN: r65865
parent 6f9106c2
2003-04-20 Zack Weinberg <zack@codesourcery.com>
* varasm.c (struct deferred_constant, defer_addressed_constants_flag)
(defer_addressed_constants, output_deferred_addressed_constants): Kill.
(output_constant_def): Remove code predicated on
defer_addressed_constants_flag.
* output.h: Remove prototypes of deleted functions.
* c-typeck.c (constructor_subconstants_deferred): Kill.
(struct initializer_stack): Remove 'deferred' field.
(start_init): Remove all references to the above.
(finish_init): Likewise. Also remove never-executed call to
output_deferred_addressed_constants. Pull assignment to
defstr out of if expression.
2003-04-20 Neil Booth <neil@daikokuya.co.uk> 2003-04-20 Neil Booth <neil@daikokuya.co.uk>
* cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH, * cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH,
......
...@@ -4931,9 +4931,6 @@ static int constructor_simple; ...@@ -4931,9 +4931,6 @@ static int constructor_simple;
/* 1 if this constructor is erroneous so far. */ /* 1 if this constructor is erroneous so far. */
static int constructor_erroneous; static int constructor_erroneous;
/* 1 if have called defer_addressed_constants. */
static int constructor_subconstants_deferred;
/* Structure for managing pending initializer elements, organized as an /* Structure for managing pending initializer elements, organized as an
AVL tree. */ AVL tree. */
...@@ -5051,7 +5048,6 @@ struct initializer_stack ...@@ -5051,7 +5048,6 @@ struct initializer_stack
char top_level; char top_level;
char require_constant_value; char require_constant_value;
char require_constant_elements; char require_constant_elements;
char deferred;
}; };
struct initializer_stack *initializer_stack; struct initializer_stack *initializer_stack;
...@@ -5082,14 +5078,12 @@ start_init (decl, asmspec_tree, top_level) ...@@ -5082,14 +5078,12 @@ start_init (decl, asmspec_tree, top_level)
p->spelling = spelling; p->spelling = spelling;
p->spelling_base = spelling_base; p->spelling_base = spelling_base;
p->spelling_size = spelling_size; p->spelling_size = spelling_size;
p->deferred = constructor_subconstants_deferred;
p->top_level = constructor_top_level; p->top_level = constructor_top_level;
p->next = initializer_stack; p->next = initializer_stack;
initializer_stack = p; initializer_stack = p;
constructor_decl = decl; constructor_decl = decl;
constructor_asmspec = asmspec; constructor_asmspec = asmspec;
constructor_subconstants_deferred = 0;
constructor_designated = 0; constructor_designated = 0;
constructor_top_level = top_level; constructor_top_level = top_level;
...@@ -5131,12 +5125,6 @@ finish_init () ...@@ -5131,12 +5125,6 @@ finish_init ()
{ {
struct initializer_stack *p = initializer_stack; struct initializer_stack *p = initializer_stack;
/* Output subconstants (string constants, usually)
that were referenced within this initializer and saved up.
Must do this if and only if we called defer_addressed_constants. */
if (constructor_subconstants_deferred)
output_deferred_addressed_constants ();
/* Free the whole constructor stack of this initializer. */ /* Free the whole constructor stack of this initializer. */
while (constructor_stack) while (constructor_stack)
{ {
...@@ -5159,7 +5147,6 @@ finish_init () ...@@ -5159,7 +5147,6 @@ finish_init ()
spelling = p->spelling; spelling = p->spelling;
spelling_base = p->spelling_base; spelling_base = p->spelling_base;
spelling_size = p->spelling_size; spelling_size = p->spelling_size;
constructor_subconstants_deferred = p->deferred;
constructor_top_level = p->top_level; constructor_top_level = p->top_level;
initializer_stack = p->next; initializer_stack = p->next;
free (p); free (p);
......
...@@ -334,13 +334,6 @@ extern void assemble_real PARAMS ((REAL_VALUE_TYPE, ...@@ -334,13 +334,6 @@ extern void assemble_real PARAMS ((REAL_VALUE_TYPE,
unsigned)); unsigned));
#endif #endif
/* Start deferring output of subconstants. */
extern void defer_addressed_constants PARAMS ((void));
/* Stop deferring output of subconstants,
and output now all those that have been deferred. */
extern void output_deferred_addressed_constants PARAMS ((void));
/* Return the size of the constant pool. */ /* Return the size of the constant pool. */
extern int get_pool_size PARAMS ((void)); extern int get_pool_size PARAMS ((void));
......
...@@ -2465,54 +2465,6 @@ compare_constant (t1, t2) ...@@ -2465,54 +2465,6 @@ compare_constant (t1, t2)
abort (); abort ();
} }
/* Record a list of constant expressions that were passed to
output_constant_def but that could not be output right away. */
struct deferred_constant
{
struct deferred_constant *next;
tree exp;
int reloc;
int labelno;
};
static struct deferred_constant *deferred_constants;
/* Nonzero means defer output of addressed subconstants
(i.e., those for which output_constant_def is called.) */
static int defer_addressed_constants_flag;
/* Start deferring output of subconstants. */
void
defer_addressed_constants ()
{
defer_addressed_constants_flag++;
}
/* Stop deferring output of subconstants,
and output now all those that have been deferred. */
void
output_deferred_addressed_constants ()
{
struct deferred_constant *p, *next;
defer_addressed_constants_flag--;
if (defer_addressed_constants_flag > 0)
return;
for (p = deferred_constants; p; p = next)
{
output_constant_def_contents (p->exp, p->reloc, p->labelno);
next = p->next;
free (p);
}
deferred_constants = 0;
}
/* Make a copy of the whole tree structure for a constant. This /* Make a copy of the whole tree structure for a constant. This
handles the same types of nodes that compare_constant handles. */ handles the same types of nodes that compare_constant handles. */
...@@ -2586,7 +2538,7 @@ copy_constant (exp) ...@@ -2586,7 +2538,7 @@ copy_constant (exp)
If assembler code for such a constant has already been output, If assembler code for such a constant has already been output,
return an rtx to refer to it. return an rtx to refer to it.
Otherwise, output such a constant in memory (or defer it for later) Otherwise, output such a constant in memory
and generate an rtx for it. and generate an rtx for it.
If DEFER is nonzero, the output of string constants can be deferred If DEFER is nonzero, the output of string constants can be deferred
...@@ -2680,9 +2632,7 @@ output_constant_def (exp, defer) ...@@ -2680,9 +2632,7 @@ output_constant_def (exp, defer)
desc->label = XSTR (XEXP (desc->rtl, 0), 0); desc->label = XSTR (XEXP (desc->rtl, 0), 0);
} }
if (found if (found && !defer && STRING_POOL_ADDRESS_P (XEXP (rtl, 0)))
&& STRING_POOL_ADDRESS_P (XEXP (rtl, 0))
&& (!defer || defer_addressed_constants_flag))
{ {
defstr = (struct deferred_string **) defstr = (struct deferred_string **)
htab_find_slot_with_hash (const_str_htab, desc->label, htab_find_slot_with_hash (const_str_htab, desc->label,
...@@ -2699,34 +2649,18 @@ output_constant_def (exp, defer) ...@@ -2699,34 +2649,18 @@ output_constant_def (exp, defer)
} }
/* If this is the first time we've seen this particular constant, /* If this is the first time we've seen this particular constant,
output it (or defer its output for later). */ output it. Do no output if -fsyntax-only. */
if (! found) if (! found && ! flag_syntax_only)
{
if (defer_addressed_constants_flag)
{ {
struct deferred_constant *p if (!defer || TREE_CODE (exp) != STRING_CST
= (struct deferred_constant *) || flag_writable_strings)
xmalloc (sizeof (struct deferred_constant)); output_constant_def_contents (exp, reloc, labelno);
p->exp = desc->value;
p->reloc = reloc;
p->labelno = labelno;
p->next = deferred_constants;
deferred_constants = p;
}
else else
{ {
/* Do no output if -fsyntax-only. */ defstr = (struct deferred_string **)
if (! flag_syntax_only) htab_find_slot_with_hash (const_str_htab, desc->label,
{ STRHASH (desc->label), INSERT);
if (TREE_CODE (exp) != STRING_CST if (!defstr)
|| !defer
|| flag_writable_strings
|| (defstr = (struct deferred_string **)
htab_find_slot_with_hash (const_str_htab,
desc->label,
STRHASH (desc->label),
INSERT)) == NULL)
output_constant_def_contents (exp, reloc, labelno); output_constant_def_contents (exp, reloc, labelno);
else else
{ {
...@@ -2743,7 +2677,6 @@ output_constant_def (exp, defer) ...@@ -2743,7 +2677,6 @@ output_constant_def (exp, defer)
} }
} }
} }
}
return rtl; return rtl;
} }
......
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