* varasm.c (struct deferred_constant, defer_addressed_constants_flag)
authorZack Weinberg <zack@codesourcery.com>
Sun, 20 Apr 2003 22:43:59 +0000 (22:43 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Sun, 20 Apr 2003 22:43:59 +0000 (22:43 +0000)
(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

gcc/ChangeLog
gcc/c-typeck.c
gcc/output.h
gcc/varasm.c

index d5773b08da3edaf49a8b65d17f1e06fb3737d052..5c7ff689178a755c3293f5c607fcecf94288a5da 100644 (file)
@@ -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,
index 871e10807f957e8f1c697260b9f8eae81184cfa9..33bce26ede62e16a360534e5285006b45d2fda05 100644 (file)
@@ -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);
index 7fd9ec9cfe6d26c88825b30eddf2ca73e048ab13..389b95f3962d7ccd4e649fe2a597c29e0c11441e 100644 (file)
@@ -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));
 
index 72141f16403255cda89dc7a5fb3efca50a5342c7..fed8b9667c08fd23743dd3caadde7602f3feb7d2 100644 (file)
@@ -2465,54 +2465,6 @@ compare_constant (t1, t2)
   abort ();
 }
 \f
-/* 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;
            }
        }
     }