From ecbc46954235fb3cc8814f02cc65ed6b34988e8a Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 11 Oct 1993 03:03:34 +0000 Subject: [PATCH] (save_386_machine_status): New functions. (restore_386_machine_status) (save_386_machine_status): New functions. (clear_386_stack_locals): Store those functions in save_machine_status, restore_machine_status. (struct machine_function): New structure definition. From-SVN: r5723 --- gcc/config/i386/i386.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3ceede3fc9c..8ef428910d0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -31,6 +31,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "insn-attr.h" #include "tree.h" #include "flags.h" +#include "function.h" #ifdef EXTRA_CONSTRAINT /* If EXTRA_CONSTRAINT is defined, then the 'S' @@ -2052,9 +2053,37 @@ output_fp_cc0_set (insn) static rtx i386_stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS]; +/* Define the structure for the machine field in struct function. */ +struct machine_function +{ + rtx i386_stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS]; +}; + +/* Functions to save and restore i386_stack_locals. + These will be called, via pointer variables, + from push_function_context and pop_function_context. */ + +void +save_386_machine_status (p) + struct function *p; +{ + p->machine = (struct machine_function *) xmalloc (sizeof i386_stack_locals); + bcopy (i386_stack_locals, p->machine->i386_stack_locals, + sizeof i386_stack_locals); +} + +void +restore_386_machine_status (p) + struct function *p; +{ + bcopy (p->machine->i386_stack_locals, i386_stack_locals, + sizeof i386_stack_locals); + free (p->machine); +} + /* Clear stack slot assignments remembered from previous functions. This is called from INIT_EXPANDERS once before RTL is emitted for each - function. */ + function. */ void clear_386_stack_locals () @@ -2066,6 +2095,10 @@ clear_386_stack_locals () mode = (enum machine_mode) ((int) mode + 1)) for (n = 0; n < MAX_386_STACK_LOCALS; n++) i386_stack_locals[(int) mode][n] = NULL_RTX; + + /* Arrange to save and restore i386_stack_locals around nested functions. */ + save_machine_status = save_386_machine_status; + restore_machine_status = restore_386_machine_status; } /* Return a MEM corresponding to a stack slot with mode MODE. -- 2.30.2