diff options
author | Zack Weinberg <zack@codesourcery.com> | 2003-04-20 22:43:59 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2003-04-20 22:43:59 +0000 |
commit | b20cbca237158906c7d24b32a4e77babbebf9a1c (patch) | |
tree | 08cb32166631a746c08540bc52e20a56ed340060 | |
parent | 6f9106c2ec710be644919df873af73e52a14959f (diff) | |
download | gcc-b20cbca237158906c7d24b32a4e77babbebf9a1c.zip gcc-b20cbca237158906c7d24b32a4e77babbebf9a1c.tar.gz gcc-b20cbca237158906c7d24b32a4e77babbebf9a1c.tar.bz2 |
* 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
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/c-typeck.c | 13 | ||||
-rw-r--r-- | gcc/output.h | 7 | ||||
-rw-r--r-- | gcc/varasm.c | 109 |
4 files changed, 36 insertions, 108 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5773b0..5c7ff68 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +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> * cpphash.h (NOTE_ESC_NL, NOTE_ESC_SPACE_NL, NOTE_TRIGRAPH, diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 871e108..33bce26 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4931,9 +4931,6 @@ static int constructor_simple; /* 1 if this constructor is erroneous so far. */ 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 AVL tree. */ @@ -5051,7 +5048,6 @@ struct initializer_stack char top_level; char require_constant_value; char require_constant_elements; - char deferred; }; struct initializer_stack *initializer_stack; @@ -5082,14 +5078,12 @@ start_init (decl, asmspec_tree, top_level) p->spelling = spelling; p->spelling_base = spelling_base; p->spelling_size = spelling_size; - p->deferred = constructor_subconstants_deferred; p->top_level = constructor_top_level; p->next = initializer_stack; initializer_stack = p; constructor_decl = decl; constructor_asmspec = asmspec; - constructor_subconstants_deferred = 0; constructor_designated = 0; constructor_top_level = top_level; @@ -5131,12 +5125,6 @@ finish_init () { 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. */ while (constructor_stack) { @@ -5159,7 +5147,6 @@ finish_init () spelling = p->spelling; spelling_base = p->spelling_base; spelling_size = p->spelling_size; - constructor_subconstants_deferred = p->deferred; constructor_top_level = p->top_level; initializer_stack = p->next; free (p); diff --git a/gcc/output.h b/gcc/output.h index 7fd9ec9..389b95f 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -334,13 +334,6 @@ extern void assemble_real PARAMS ((REAL_VALUE_TYPE, unsigned)); #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. */ extern int get_pool_size PARAMS ((void)); diff --git a/gcc/varasm.c b/gcc/varasm.c index 72141f16..fed8b96 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2465,54 +2465,6 @@ compare_constant (t1, t2) 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 handles the same types of nodes that compare_constant handles. */ @@ -2586,7 +2538,7 @@ copy_constant (exp) If assembler code for such a constant has already been output, 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. If DEFER is nonzero, the output of string constants can be deferred @@ -2680,9 +2632,7 @@ output_constant_def (exp, defer) desc->label = XSTR (XEXP (desc->rtl, 0), 0); } - if (found - && STRING_POOL_ADDRESS_P (XEXP (rtl, 0)) - && (!defer || defer_addressed_constants_flag)) + if (found && !defer && STRING_POOL_ADDRESS_P (XEXP (rtl, 0))) { defstr = (struct deferred_string **) htab_find_slot_with_hash (const_str_htab, desc->label, @@ -2699,48 +2649,31 @@ output_constant_def (exp, defer) } /* If this is the first time we've seen this particular constant, - output it (or defer its output for later). */ - if (! found) + output it. Do no output if -fsyntax-only. */ + if (! found && ! flag_syntax_only) { - if (defer_addressed_constants_flag) - { - struct deferred_constant *p - = (struct deferred_constant *) - xmalloc (sizeof (struct deferred_constant)); - - p->exp = desc->value; - p->reloc = reloc; - p->labelno = labelno; - p->next = deferred_constants; - deferred_constants = p; - } + if (!defer || TREE_CODE (exp) != STRING_CST + || flag_writable_strings) + output_constant_def_contents (exp, reloc, labelno); else { - /* Do no output if -fsyntax-only. */ - if (! flag_syntax_only) + defstr = (struct deferred_string **) + htab_find_slot_with_hash (const_str_htab, desc->label, + STRHASH (desc->label), INSERT); + if (!defstr) + output_constant_def_contents (exp, reloc, labelno); + else { - if (TREE_CODE (exp) != STRING_CST - || !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); - else - { - struct deferred_string *p; + struct deferred_string *p; - p = (struct deferred_string *) - ggc_alloc (sizeof (struct deferred_string)); + p = (struct deferred_string *) + ggc_alloc (sizeof (struct deferred_string)); - p->exp = desc->value; - p->label = desc->label; - p->labelno = labelno; - *defstr = p; - STRING_POOL_ADDRESS_P (XEXP (rtl, 0)) = 1; - } + p->exp = desc->value; + p->label = desc->label; + p->labelno = labelno; + *defstr = p; + STRING_POOL_ADDRESS_P (XEXP (rtl, 0)) = 1; } } } |