]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ggc-none.c, [...] (ggc_alloc_obj): Rename it ggc_alloc, drop second argument, never...
authorZack Weinberg <zack@gcc.gnu.org>
Fri, 9 Jun 2000 21:47:40 +0000 (21:47 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 9 Jun 2000 21:47:40 +0000 (21:47 +0000)
toplevel:
* ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename
it ggc_alloc, drop second argument, never clear returned memory.
* ggc-common.c (ggc_alloc_string): Use ggc_alloc.
(ggc_alloc_cleared): New.
* ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not
ggc_alloc_obj.  Remove ggc_alloc macro.
(ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc.

* rtl.c (rtvec_alloc): Clear the vector always.
(rtx_alloc): Clear the first word always.  Remove dirty
obstack tricks (this routine is no longer a bottleneck).
* tree.c (make_node): Clear the new node always.
(make_tree_vec): Likewise.
(tree_cons): Clear the common structure always.
(build1): Likewise; also, clear TREE_COMPLEXITY.
* gengenrtl.c: Use puts wherever possible.  Remove extra
newlines.
(gendef): Clear the first word of an RTX in the generator
function, irrespective of ggc_p.  Initialize '0' slots to
NULL.
(genlegend): Don't generate obstack_alloc_rtx routine, just a
thin wrapper macro around obstack_alloc.

* stmt.c (expand_fixup): Use ggc_alloc.
* c-typeck.c (add_pending_init): Use ggc_alloc.
* emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem).
* varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to
const0_rtx when it is created.
(immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if
we are not in a function.

* tree.c (tree_class_check_failed): Make second arg an int.
* tree.h: Update prototype.

cp:
* call.c (add_candidate): Use ggc_alloc_cleared.
* decl.c (lookup_label): Likewise.
* lex.c (retrofit_lang_decl): Likewise.

From-SVN: r34478

18 files changed:
gcc/ChangeLog
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl.c
gcc/cp/lex.c
gcc/emit-rtl.c
gcc/gengenrtl.c
gcc/ggc-common.c
gcc/ggc-none.c
gcc/ggc-page.c
gcc/ggc-simple.c
gcc/ggc.h
gcc/rtl.c
gcc/stmt.c
gcc/tree.c
gcc/tree.h
gcc/varasm.c

index 13fb2d652c7dd1bb4e87d58fc161cc6de25379e1..f4e9ea5692019791b0e9de112e02a692aa7c4497 100644 (file)
@@ -1,7 +1,43 @@
+2000-06-09  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename
+       it ggc_alloc, drop second argument, never clear returned memory.
+       * ggc-common.c (ggc_alloc_string): Use ggc_alloc.
+       (ggc_alloc_cleared): New.
+       * ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not
+       ggc_alloc_obj.  Remove ggc_alloc macro.
+       (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc.
+
+       * rtl.c (rtvec_alloc): Clear the vector always.
+       (rtx_alloc): Clear the first word always.  Remove dirty
+       obstack tricks (this routine is no longer a bottleneck).
+       * tree.c (make_node): Clear the new node always.
+       (make_tree_vec): Likewise.
+       (tree_cons): Clear the common structure always.  
+       (build1): Likewise; also, clear TREE_COMPLEXITY.
+       * gengenrtl.c: Use puts wherever possible.  Remove extra
+       newlines.
+       (gendef): Clear the first word of an RTX in the generator
+       function, irrespective of ggc_p.  Initialize '0' slots to
+       NULL.
+       (genlegend): Don't generate obstack_alloc_rtx routine, just a
+       thin wrapper macro around obstack_alloc.
+
+       * stmt.c (expand_fixup): Use ggc_alloc.
+       * c-typeck.c (add_pending_init): Use ggc_alloc.
+       * emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem).
+       * varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to
+       const0_rtx when it is created.
+       (immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if
+       we are not in a function.
+
+       * tree.c (tree_class_check_failed): Make second arg an int.
+       * tree.h: Update prototype.
+
 2000-06-09  Geoff Keating  <geoffk@cygnus.com>
 
        * tree.h (VOID_TYPE_P): Don't look at the TYPE_MAIN_VARIANT
-       of an error_type_node.
+       of an error_mark_node.
 
 Fri Jun  9 20:35:13 2000  Denis Chertykov  <denisc@overta.ru>
 
index c4065b4c89e89b0ff04bc4830b4b42a7f4c0e648..6f19fc4207b14c633b6d099c42cd7ca8749e0005 100644 (file)
@@ -5595,7 +5595,7 @@ add_pending_init (purpose, value)
        }
     }
 
-  r = (struct init_node *) ggc_alloc_obj (sizeof (struct init_node), 0);
+  r = (struct init_node *) ggc_alloc (sizeof (struct init_node));
   r->purpose = purpose;
   r->value = value;
 
index ed1fdabac0366ae6dfe38900047a97016fca94d1..1f570cc9d6e873860f765e43c518ee05013e59cc 100644 (file)
@@ -1,3 +1,9 @@
+2000-06-09  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * call.c (add_candidate): Use ggc_alloc_cleared.
+       * decl.c (lookup_label): Likewise.
+       * lex.c (retrofit_lang_decl): Likewise.
+
 2000-06-09  Jason Merrill  <jason@casey.soma.redhat.com>
 
        * semantics.c (expand_body): Push to TV_EXPAND.
index 5cabf137b92fb5cc274cd93142b4418e3cb49dde..dcbe6c7602600f4ecd098eb3985d18b3c409e089 100644 (file)
@@ -1250,7 +1250,7 @@ add_candidate (candidates, fn, convs, viable)
      int viable;
 {
   struct z_candidate *cand
-    = (struct z_candidate *) ggc_alloc_obj (sizeof (struct z_candidate), 1);
+    = (struct z_candidate *) ggc_alloc_cleared (sizeof (struct z_candidate));
 
   cand->fn = fn;
   cand->convs = convs;
index f9f52fac6302e5754551e0674e6c703b18f0b4bf..ad53c09a07f4164d14fb804a7328e226f5fefc83 100644 (file)
@@ -4832,7 +4832,7 @@ lookup_label (id)
      We do this before calling make_label_decl so that we get the
      IDENTIFIER_LABEL_VALUE before the new label is declared.  */
   ent = ((struct named_label_list *)
-        ggc_alloc_obj (sizeof (struct named_label_list), 1));
+        ggc_alloc_cleared (sizeof (struct named_label_list)));
   ent->old_value = IDENTIFIER_LABEL_VALUE (id);
   ent->next = named_labels;
   named_labels = ent;
index 8fbbbc40ec4f212d84be57bf095775c7ad36d542..a4dc2cf30b63dffa3b6ad0e716fbb93595f8330a 100644 (file)
@@ -4776,7 +4776,7 @@ retrofit_lang_decl (t)
   else
     size = sizeof (struct lang_decl_flags);
 
-  ld = (struct lang_decl *) ggc_alloc_obj (size, 1);
+  ld = (struct lang_decl *) ggc_alloc_cleared (size);
 
   DECL_LANG_SPECIFIC (t) = ld;
   if (current_lang_name == lang_name_cplusplus)
index d9a6c65c9cf304239727f7de31d5edda574242a2..fcabed2e5283f9da4f9746d911bf18fccdefe5c2 100644 (file)
@@ -4125,6 +4125,7 @@ init_emit_once (line_numbers)
 
          bcopy ((char *) &u, (char *) &CONST_DOUBLE_LOW (tem), sizeof u);
          CONST_DOUBLE_MEM (tem) = cc0_rtx;
+         CONST_DOUBLE_CHAIN (tem) = NULL_RTX;
          PUT_MODE (tem, mode);
 
          const_tiny_rtx[i][(int) mode] = tem;
index 26450a9e750ae1a6a229b61b677f177fddbdc890..54dccf1d0dff2ba3560f44e46ed9294575fb9f6a 100644 (file)
@@ -272,7 +272,7 @@ genmacro (idx)
     if (*p != '0')
       printf (", (ARG%d)", i++);
 
-  printf (")\n");
+  puts (")");
 }
 
 /* Generate the code for the function to generate RTL whose
@@ -293,30 +293,31 @@ gendef (format)
     if (*p != '0')
       printf (", arg%d", i++);
 
-  printf (")\n     RTX_CODE code;\n     enum machine_mode mode;\n");
+  puts (")\n     RTX_CODE code;\n     enum machine_mode mode;");
   for (p = format, i = 0; *p != 0; p++)
     if (*p != '0')
       printf ("     %sarg%d;\n", type_from_format (*p), i++);
 
   /* Now write out the body of the function itself, which allocates
      the memory and initializes it.  */
-  printf ("{\n");
-  printf ("  rtx rt;\n");
-  printf ("  if (ggc_p)\n");
-  printf ("    rt = ggc_alloc_rtx (%d);\n", 
-          (int) strlen (format));
-  printf ("  else\n");
-  printf ("    rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n",
-          (int) strlen (format) - 1);
-
-  printf ("  PUT_CODE (rt, code);\n");
-  printf ("  PUT_MODE (rt, mode);\n");
+  puts ("{");
+  puts ("  rtx rt;");
+  puts ("  if (ggc_p)");
+  printf ("    rt = ggc_alloc_rtx (%d);\n", (int) strlen (format));
+  puts ("  else");
+  printf ("    rt = obstack_alloc_rtx (%d);\n", (int) strlen (format));
+
+  puts ("  memset (rt, 0, sizeof (struct rtx_def) - sizeof (rtunion));\n");
+  puts ("  PUT_CODE (rt, code);");
+  puts ("  PUT_MODE (rt, mode);");
 
   for (p = format, i = j = 0; *p ; ++p, ++i)
     if (*p != '0')
       printf ("  %s (rt, %d) = arg%d;\n", accessor_from_format (*p), i, j++);
+    else
+      printf ("  X0EXP (rt, %d) = NULL_RTX;\n", i);
 
-  printf ("\n  return rt;\n}\n\n");
+  puts ("\n  return rt;\n}\n");
 }
 
 /* Generate the documentation header for files we write.  */
@@ -324,8 +325,7 @@ gendef (format)
 static void
 genlegend ()
 {
-  printf ("/* Generated automatically by the program `gengenrtl'\n");
-  printf ("   from the RTL description file `rtl.def' */\n\n");
+  puts ("/* Generated automatically by gengenrtl from rtl.def.  */\n");
 }
 
 /* Generate the text of the header file we make, genrtl.h.  */
@@ -339,7 +339,7 @@ genheader ()
   for (fmt = formats; *fmt; ++fmt)
     gendecl (*fmt);
 
-  printf ("\n");
+  putchar ('\n');
 
   for (i = 0; i < NUM_RTX_CODE; i++)
     if (! special_format (defs[i].format))
@@ -353,19 +353,16 @@ gencode ()
 {
   const char **fmt;
 
-  puts ("#include \"config.h\"\n");
-  puts ("#include \"system.h\"\n");
-  puts ("#include \"obstack.h\"\n");
-  puts ("#include \"rtl.h\"\n");
-  puts ("#include \"ggc.h\"\n\n");
-  puts ("extern struct obstack *rtl_obstack;\n\n");
-  puts ("static rtx obstack_alloc_rtx PARAMS ((int length));\n");
-  puts ("static rtx\n");
-  puts ("obstack_alloc_rtx (length)\n");
-  puts ("     register int length;\n{\n");
-  puts ("  rtx rt = (rtx) obstack_alloc (rtl_obstack, length);\n\n");
-  puts ("  memset(rt, 0, sizeof(struct rtx_def) - sizeof(rtunion));\n\n");
-  puts ("  return rt;\n}\n\n");
+  puts ("#include \"config.h\"");
+  puts ("#include \"system.h\"");
+  puts ("#include \"obstack.h\"");
+  puts ("#include \"rtl.h\"");
+  puts ("#include \"ggc.h\"\n");
+  puts ("extern struct obstack *rtl_obstack;\n");
+  puts ("#define obstack_alloc_rtx(n)                                  \\");
+  puts ("    ((rtx) obstack_alloc (rtl_obstack,                                \\");
+  puts ("                        sizeof (struct rtx_def)               \\");
+  puts ("                        + ((n) - 2) * sizeof (rtunion)))\n");
 
   for (fmt = formats; *fmt != 0; fmt++)
     gendef (*fmt);
index 74b554702f7b9bce9cb9fe27ac07a57892436e71..fc8fb6537909f4aef0a6b03b20840277fb81a689 100644 (file)
@@ -580,7 +580,7 @@ ggc_alloc_string (contents, length)
       length = strlen (contents);
     }
 
-  string = (char *) ggc_alloc_obj (length + 1, 0);
+  string = (char *) ggc_alloc (length + 1);
   if (contents != NULL)
     memcpy (string, contents, length);
   string[length] = 0;
@@ -588,6 +588,16 @@ ggc_alloc_string (contents, length)
   return string;
 }
 
+/* Allocate a block of memory, then clear it.  */
+void *
+ggc_alloc_cleared (size)
+     size_t size;
+{
+  void *buf = ggc_alloc (size);
+  memset (buf, 0, size);
+  return buf;
+}
+
 /* Print statistics that are independent of the collector in use.  */
 
 void
index e05107ec8db095493a37f8fbee05348c6e9acb98..f006ae89a0f43cd6ba3090fa8bee15ecf6d7c3d8 100644 (file)
 int ggc_p = 0;
 
 void *
-ggc_alloc_obj (size, zero)
+ggc_alloc (size)
      size_t size;
-     int zero;
 {
-  void *p = xmalloc (size);
-  if (zero)
-    memset (p, 0, size);
-  return p;
+  return xmalloc (size);
 }
index 924e952b336781b431191714328bfffe5a38c47f..2a7e1014fd2b5a2cebb589d6ed441722baf872c5 100644 (file)
@@ -611,9 +611,8 @@ static unsigned char const size_lookup[257] =
    memory is zeroed; otherwise, its contents are undefined.  */
 
 void *
-ggc_alloc_obj (size, zero)
+ggc_alloc (size)
      size_t size;
-     int zero;
 {
   unsigned order, word, bit, object_offset;
   struct page_entry *entry;
@@ -703,14 +702,11 @@ ggc_alloc_obj (size, zero)
   result = entry->page + object_offset;
 
 #ifdef GGC_POISON
-  /* `Poison' the entire allocated object before zeroing the requested area,
-     so that bytes beyond the end, if any, will not necessarily be zero.  */
+  /* `Poison' the entire allocated object, including any padding at
+     the end.  */
   memset (result, 0xaf, 1 << order);
 #endif
 
-  if (zero)
-    memset (result, 0, size);
-
   /* Keep track of how many bytes are being allocated.  This
      information is used in deciding when to collect.  */
   G.allocated += (size_t) 1 << order;
index e4fbddb53a36e1ae6c50659c8e1f95eec0fffa81..86afaf17e12b4d141315186e4a49d57e4331b198 100644 (file)
@@ -182,9 +182,8 @@ tree_lookup (v)
 /* Alloc SIZE bytes of GC'able memory.  If ZERO, clear the memory.  */
 
 void *
-ggc_alloc_obj (size, zero)
+ggc_alloc (size)
      size_t size;
-     int zero;
 {
   struct ggc_mem *x;
 
@@ -195,11 +194,8 @@ ggc_alloc_obj (size, zero)
   x->context = G.context;
   x->size = size;
 
-  if (zero)
-    memset (&x->u, 0, size);
 #ifdef GGC_POISON
-  else
-    memset (&x->u, 0xaf, size);
+  memset (&x->u, 0xaf, size);
 #endif
 
   tree_insert (x);
index 9ee6c3dd7a9d32fc35ebde69dccaed4a3212a91c..81e7012dcd63643f7e58a7b92843ac6a41388fe2 100644 (file)
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -128,20 +128,19 @@ extern void ggc_pop_context PARAMS ((void));
 /* Allocation.  */
 
 /* The internal primitive.  */
-void *ggc_alloc_obj PARAMS ((size_t, int));
+void *ggc_alloc PARAMS ((size_t));
+/* Like ggc_alloc, but allocates cleared memory.  */
+void *ggc_alloc_cleared PARAMS ((size_t));
 
-#define ggc_alloc_rtx(NSLOTS)                                               \
-  ((struct rtx_def *) ggc_alloc_obj (sizeof (struct rtx_def)                \
-                                    + ((NSLOTS) - 1) * sizeof (rtunion), 1))
+#define ggc_alloc_rtx(NSLOTS)                                            \
+  ((struct rtx_def *) ggc_alloc (sizeof (struct rtx_def)                 \
+                                + ((NSLOTS) - 1) * sizeof (rtunion)))
 
 #define ggc_alloc_rtvec(NELT)                                            \
-  ((struct rtvec_def *) ggc_alloc_obj (sizeof (struct rtvec_def)         \
-                                      + ((NELT) - 1) * sizeof (rtx), 1))
+  ((struct rtvec_def *) ggc_alloc (sizeof (struct rtvec_def)             \
+                                  + ((NELT) - 1) * sizeof (rtx)))
 
-#define ggc_alloc_tree(LENGTH)                         \
-  ((union tree_node *) ggc_alloc_obj ((LENGTH), 1))
-
-#define ggc_alloc(SIZE)  ggc_alloc_obj((SIZE), 0)
+#define ggc_alloc_tree(LENGTH) ((union tree_node *) ggc_alloc (LENGTH))
 
 char *ggc_alloc_string PARAMS ((const char *contents, int length));
 
index 84a2df0e20aa3545e7f994d0bea740ecf2af6529..6c771f695e44ddd34a125af9c11bc688568e9a5d 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -279,17 +279,11 @@ rtvec_alloc (n)
   if (ggc_p)
     rt = ggc_alloc_rtvec (n);
   else
-    {
-      int i;
-
-      rt = (rtvec) obstack_alloc (rtl_obstack,
-                                 sizeof (struct rtvec_def)
-                                 + (( n - 1) * sizeof (rtx)));
-
-      /* clear out the vector */
-      for (i = 0; i < n; i++)
-       rt->elem[i] = 0;
-    }
+    rt = (rtvec) obstack_alloc (rtl_obstack,
+                               sizeof (struct rtvec_def)
+                               + ((n - 1) * sizeof (rtx)));
+  /* clear out the vector */
+  memset (&rt->elem[0], 0, n * sizeof (rtx));
 
   PUT_NUM_ELEM (rt, n);
   return rt;
@@ -303,39 +297,20 @@ rtx_alloc (code)
   RTX_CODE code;
 {
   rtx rt;
+  int n = GET_RTX_LENGTH (code);
 
   if (ggc_p)
-    rt = ggc_alloc_rtx (GET_RTX_LENGTH (code));
+    rt = ggc_alloc_rtx (n);
   else
-    {
-      register struct obstack *ob = rtl_obstack;
-      register int nelts = GET_RTX_LENGTH (code);
-      register int length = sizeof (struct rtx_def)
-       + (nelts - 1) * sizeof (rtunion);
-
-      /* This function is called more than any other in GCC, so we
-        manipulate the obstack directly.
+    rt = (rtx) obstack_alloc (rtl_obstack,
+                             sizeof (struct rtx_def)
+                             + ((n - 1) * sizeof (rtunion)));
 
-        Even though rtx objects are word aligned, we may be sharing
-        an obstack with tree nodes, which may have to be double-word
-        aligned.  So align our length to the alignment mask in the
-        obstack.  */
-
-      length = (length + ob->alignment_mask) & ~ ob->alignment_mask;
-
-      if (ob->chunk_limit - ob->next_free < length)
-       _obstack_newchunk (ob, length);
-      rt = (rtx)ob->object_base;
-      ob->next_free += length;
-      ob->object_base = ob->next_free;
-
-      /* We want to clear everything up to the FLD array.  Normally,
-        this is one int, but we don't want to assume that and it
-        isn't very portable anyway; this is.  */
-
-      memset (rt, 0, sizeof (struct rtx_def) - sizeof (rtunion));
-    }
+  /* We want to clear everything up to the FLD array.  Normally, this
+     is one int, but we don't want to assume that and it isn't very
+     portable anyway; this is.  */
 
+  memset (rt, 0, sizeof (struct rtx_def) - sizeof (rtunion));
   PUT_CODE (rt, code);
   return rt;
 }
index 41a1b4f2db2b5ce04d26826fb225787a6a12c803..14ce4a9b39e71941eb6bf60f3a9da9fb369e1e80 100644 (file)
@@ -1011,7 +1011,7 @@ expand_fixup (tree_label, rtl_label, last_insn)
     {
       /* Ok, a fixup is needed.  Add a fixup to the list of such.  */
       struct goto_fixup *fixup
-       = (struct goto_fixup *) ggc_alloc_obj (sizeof (struct goto_fixup), 0);
+       = (struct goto_fixup *) ggc_alloc (sizeof (struct goto_fixup));
       /* In case an old stack level is restored, make sure that comes
         after any pending stack adjust.  */
       /* ?? If the fixup isn't to come at the present position,
index 9eee62b0c2f31d88ac7b3242581ccb3ddb25f2df..103240302620f6a5d1e9509afe117fbfcb383b94 100644 (file)
@@ -1041,10 +1041,9 @@ make_node (code)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    {
-      t = (tree) obstack_alloc (obstack, length);
-      memset ((PTR) t, 0, length);
-    }
+    t = (tree) obstack_alloc (obstack, length);
+
+  memset ((PTR) t, 0, length);
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int)kind]++;
@@ -1604,11 +1603,9 @@ make_tree_vec (len)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    {
-      t = (tree) obstack_alloc (obstack, length);
-      bzero ((PTR) t, length);
-    }
+    t = (tree) obstack_alloc (obstack, length);
 
+  memset ((PTR) t, 0, length);
   TREE_SET_CODE (t, TREE_VEC);
   TREE_VEC_LENGTH (t) = len;
   TREE_SET_PERMANENT (t);
@@ -2164,10 +2161,9 @@ tree_cons (purpose, value, chain)
   if (ggc_p)
     node = ggc_alloc_tree (sizeof (struct tree_list));
   else
-    {
-      node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
-      memset (node, 0, sizeof (struct tree_common));
-    }
+    node = (tree) obstack_alloc (current_obstack, sizeof (struct tree_list));
+
+  memset (node, 0, sizeof (struct tree_common));
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int) x_kind]++;
@@ -3384,20 +3380,20 @@ build1 (code, type, node)
   if (ggc_p)
     t = ggc_alloc_tree (length);
   else
-    {
-      t = (tree) obstack_alloc (obstack, length);
-      memset ((PTR) t, 0, length);
-    }
+    t = (tree) obstack_alloc (obstack, length);
+
+  memset ((PTR) t, 0, sizeof (struct tree_common));
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int)kind]++;
   tree_node_sizes[(int)kind] += length;
 #endif
 
-  TREE_TYPE (t) = type;
   TREE_SET_CODE (t, code);
   TREE_SET_PERMANENT (t);
 
+  TREE_TYPE (t) = type;
+  TREE_COMPLEXITY (t) = 0;
   TREE_OPERAND (t, 0) = node;
   if (node && first_rtl_op (code) != 0 && TREE_SIDE_EFFECTS (node))
     TREE_SIDE_EFFECTS (t) = 1;
@@ -5599,7 +5595,7 @@ tree_check_failed (node, code, file, line, function)
 void
 tree_class_check_failed (node, cl, file, line, function)
      const tree node;
-     char cl;
+     int cl;
      const char *file;
      int line;
      const char *function;
index 5648ecc9f05e6d6ad2203285912a520b4c318ed3..5f5488d655544ec97fa4979a657a4d88ff9b12ab 100644 (file)
@@ -309,10 +309,10 @@ struct tree_common
     __t; })
 
 extern void tree_check_failed PARAMS ((const tree, enum tree_code,
-                                    const char *, int, const char *))
+                                      const char *, int, const char *))
     ATTRIBUTE_NORETURN;
-extern void tree_class_check_failed PARAMS ((const tree, char,
-                                          const char *, int, const char *))
+extern void tree_class_check_failed PARAMS ((const tree, int,
+                                            const char *, int, const char *))
     ATTRIBUTE_NORETURN;
 
 #else /* not ENABLE_TREE_CHECKING, or not gcc */
index 75af9466530ef2c83e6952105b8101089b53269a..d2da769ea4b8772d79ed6d778df089535b46522e 100644 (file)
@@ -2121,7 +2121,7 @@ immed_double_const (i0, i1, mode)
 
   push_obstacks_nochange ();
   rtl_in_saveable_obstack ();
-  r = gen_rtx_CONST_DOUBLE (mode, NULL_RTX, i0, i1);
+  r = gen_rtx_CONST_DOUBLE (mode, const0_rtx, i0, i1);
   pop_obstacks ();
 
   /* Don't touch const_double_chain if not inside any function.  */
@@ -2131,11 +2131,6 @@ immed_double_const (i0, i1, mode)
       const_double_chain = r;
     }
 
-  /* Store const0_rtx in mem-slot since this CONST_DOUBLE is on the chain.
-     Actual use of mem-slot is only through force_const_mem.  */
-
-  CONST_DOUBLE_MEM (r) = const0_rtx;
-
   return r;
 }
 
@@ -2201,12 +2196,15 @@ immed_real_const_1 (d, mode)
   PUT_MODE (r, mode);
   bcopy ((char *) &u, (char *) &CONST_DOUBLE_LOW (r), sizeof u);
 
-  /* Don't touch const_double_chain if not inside any function.  */
+  /* If we aren't inside a function, don't put r on the
+     const_double_chain.  */
   if (current_function_decl != 0)
     {
       CONST_DOUBLE_CHAIN (r) = const_double_chain;
       const_double_chain = r;
     }
+  else
+    CONST_DOUBLE_CHAIN (r) = NULL_RTX;
 
   /* Store const0_rtx in CONST_DOUBLE_MEM since this CONST_DOUBLE is on the
      chain, but has not been allocated memory.  Actual use of CONST_DOUBLE_MEM