emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx.
authorZack Weinberg <zack@gcc.gnu.org>
Fri, 14 Feb 2003 05:42:30 +0000 (05:42 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 14 Feb 2003 05:42:30 +0000 (05:42 +0000)
* emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx.
* function.h (struct emit_status): Length of regno_pointer_align
and x_regno_reg_rtx as seen by gengtype is only x_reg_rtx_no,
not regno_pointer_align_length (i.e. length actually used, not
length as allocated)

* config/i386/i386.c (struct stack_local_entry): New.
(struct machine_function): Replace huge array with alist.
(assign_386_stack_local): Change to match.

From-SVN: r62891

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/emit-rtl.c
gcc/function.h

index ad633eecc45b3851f64c46ff81fc76d0d2d0fa4e..3cfab102d17b1a63de6c9230009de56182159320 100644 (file)
@@ -1,3 +1,15 @@
+2003-02-13  Zack Weinberg  <zack@codesourcery.com>
+
+       * emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx.
+       * function.h (struct emit_status): Length of regno_pointer_align
+       and x_regno_reg_rtx as seen by gengtype is only x_reg_rtx_no,
+       not regno_pointer_align_length (i.e. length actually used, not
+       length as allocated)
+
+       * config/i386/i386.c (struct stack_local_entry): New.
+       (struct machine_function): Replace huge array with alist.
+       (assign_386_stack_local): Change to match.
+
 2003-02-13  John David Anglin  <dave.anglin@nrc-crnc.gc.ca>
 
        * inclhack.def (hpux_long_double): Tighten select and add bypass
@@ -47,7 +59,7 @@
        * config/h8300/h8300.md (a peephole2): New.
 
 2003-02-13  Robert Lipe <robertlipe@usa.net>
-            Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
+           Gerald Pfeifer  <pfeifer@dbai.tuwien.ac.at>
 
        * doc/install.texi (Specific): Update three SCO-related URLs.
 
 
 2003-02-12  Aldy Hernandez  <aldyh@redhat.com>
 
-        * config/rs6000/spe.h: Add casts to the arguments of the following
-        macros: evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul,
-        evfsdiv, evfscfui, evfscfsi evfscfuf evfscfsf, evfsctui, evfsctsi,
-        evfsctuf, evfsctsf, evfsctuiz, evfsctsiz, __ev_get_upper*,
-        __ev_get_lower*, __ev_get_u32, __ev_get_s32, __ev_get_fs,
-        __ev_get_u16, __ev_get_s16.
+       * config/rs6000/spe.h: Add casts to the arguments of the following
+       macros: evfsabs, evfsnabs, evfsneg, evfsadd, evfssub, evfsmul,
+       evfsdiv, evfscfui, evfscfsi evfscfuf evfscfsf, evfsctui, evfsctsi,
+       evfsctuf, evfsctsf, evfsctuiz, evfsctsiz, __ev_get_upper*,
+       __ev_get_lower*, __ev_get_u32, __ev_get_s32, __ev_get_fs,
+       __ev_get_u16, __ev_get_s16.
 
 2003-02-12  Kazu Hirata  <kazu@cs.umass.edu>
 
@@ -125,11 +137,11 @@ Wed Feb 12 22:47:18 CET 2003  Jan Hubicka  <jh@suse.cz>
 
 2003-02-12  Aldy Hernandez  <aldyh@redhat.com>
 
-        * config/rs6000/spe.h: Fix misc formatting.
-        (__ev_create_ufix32_fs): Cast ev argument.
-        (__ev_create_sfix32_fs): Same.
-        (__ev_get_sfix32_fs_internal): Cast arguments to builtins.
-        (__ev_get_ufix32_fs_internal): Same.
+       * config/rs6000/spe.h: Fix misc formatting.
+       (__ev_create_ufix32_fs): Cast ev argument.
+       (__ev_create_sfix32_fs): Same.
+       (__ev_get_sfix32_fs_internal): Cast arguments to builtins.
+       (__ev_get_ufix32_fs_internal): Same.
 
 2003-02-12  Ranjit Mathew  <rmathew@hotmail.com>
 
index cad5c60cd659b5b001d7e6308cb8a2129a923e75..c627e3d4a17c0396e58ab13c9e9fb5b0f56182e0 100644 (file)
@@ -679,9 +679,19 @@ static char const tls_model_chars[] = " GLil";
 #define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16)
 
 /* Define the structure for the machine field in struct function.  */
+
+struct stack_local_entry GTY(())
+{
+  unsigned short mode;
+  unsigned short n;
+  rtx rtl;
+  struct stack_local_entry *next;
+};
+
+
 struct machine_function GTY(())
 {
-  rtx stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS];
+  struct stack_local_entry *stack_locals;
   const char *some_ld_name;
   int save_varrargs_registers;
   int accesses_prev_frame;
@@ -11634,14 +11644,24 @@ assign_386_stack_local (mode, n)
      enum machine_mode mode;
      int n;
 {
+  struct stack_local_entry *s;
+
   if (n < 0 || n >= MAX_386_STACK_LOCALS)
     abort ();
 
-  if (ix86_stack_locals[(int) mode][n] == NULL_RTX)
-    ix86_stack_locals[(int) mode][n]
-      = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
+  for (s = ix86_stack_locals; s; s = s->next)
+    if (s->mode == mode && s->n == n)
+      return s->rtl;
+
+  s = (struct stack_local_entry *)
+    ggc_alloc (sizeof (struct stack_local_entry));
+  s->n = n;
+  s->mode = mode;
+  s->rtl = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
 
-  return ix86_stack_locals[(int) mode][n];
+  s->next = ix86_stack_locals;
+  ix86_stack_locals = s;
+  return s->rtl;
 }
 
 /* Construct the SYMBOL_REF for the tls_get_addr function.  */
index 396579e6471b4ef76f3c7441fbdf54f607f13b38..aefa8740716416fb03947e53ae6496bb40c594e0 100644 (file)
@@ -5350,8 +5350,7 @@ init_emit ()
                                           * sizeof (unsigned char));
 
   regno_reg_rtx
-    = (rtx *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
-                                * sizeof (rtx));
+    = (rtx *) ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
 
   /* Put copies of all the hard registers into regno_reg_rtx.  */
   memcpy (regno_reg_rtx,
index 22bb9da40179f8a3ca574ea17eff00c8adbc97aa..d92b815296353a2ab17e8b1afde04ded1ec94a65 100644 (file)
@@ -97,7 +97,7 @@ struct emit_status GTY(())
   /* Indexed by pseudo register number, if nonzero gives the known alignment
      for that pseudo (if REG_POINTER is set in x_regno_reg_rtx).
      Allocated in parallel with x_regno_reg_rtx.  */
-  unsigned char * GTY ((length ("%h.regno_pointer_align_length"))) 
+  unsigned char * GTY ((length ("%h.x_reg_rtx_no")))
     regno_pointer_align;
 
   /* Indexed by pseudo register number, gives the rtx for that pseudo.
@@ -105,7 +105,7 @@ struct emit_status GTY(())
 
      Note MEM expressions can appear in this array due to the actions
      of put_var_into_stack.  */
-  rtx * GTY ((length ("%h.regno_pointer_align_length"))) x_regno_reg_rtx;
+  rtx * GTY ((length ("%h.x_reg_rtx_no"))) x_regno_reg_rtx;
 };
 
 /* For backward compatibility... eventually these should all go away.  */