From ddb0ae00a2fefc266ad0cd0fa12de4368c23e97a Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 14 Feb 2003 05:42:30 +0000 Subject: [PATCH] emit-rtl.c (init_emit): Use ggc_alloc for regno_reg_rtx. * 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 | 36 ++++++++++++++++++++++++------------ gcc/config/i386/i386.c | 30 +++++++++++++++++++++++++----- gcc/emit-rtl.c | 3 +-- gcc/function.h | 4 ++-- 4 files changed, 52 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad633eecc45..3cfab102d17 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-02-13 Zack Weinberg + + * 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 * 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 - Gerald Pfeifer + Gerald Pfeifer * doc/install.texi (Specific): Update three SCO-related URLs. @@ -80,12 +92,12 @@ 2003-02-12 Aldy Hernandez - * 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 @@ -125,11 +137,11 @@ Wed Feb 12 22:47:18 CET 2003 Jan Hubicka 2003-02-12 Aldy Hernandez - * 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 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index cad5c60cd65..c627e3d4a17 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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. */ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 396579e6471..aefa8740716 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -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, diff --git a/gcc/function.h b/gcc/function.h index 22bb9da4017..d92b8152963 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -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. */ -- 2.30.2