This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] powerpc64 very large stack frames


This patch allows stack frames on powerpc64 whose sizes require more
than 32 bits.

The patch uses "long long" rather than "HOST_WIDE_INT" because struct
rs6000_stack is defined in a header file that is included for library
and startup file builds as well as for compiler builds.

Bootstrapped and regtested on powerpc-linux and tested with cross
compilers for powerpc64-linux.  Test gcc.c-torture/compile/20031023-4.c
ICEs without this patch but passes with it.  Tests of large stack frames,
large global variables, and large memory blocks allocated via alloca and
malloc were tested on powerpc64-linux, but require lots of physical
memory plus swap space to run and so are not included here.

OK for mainline?  This doesn't fix a regression, but is it OK for the
3.3 branch since it affects only the rs6000 backend?

2003-11-10  Janis Johnson  <janis187@us.ibm.com>

	* gcc/config/rs6000/rs6000.c (emit_frame_save): Change type of
	total_size to long long.
	(rs6000_stack_info): Change type of total_raw_size to long long.
	(debug_stack_info): Use long long format for vars_size and total_size.
	* gcc/config/rs6000/rs6000.h (rs6000_stack): Change type of vars_size
	and total_size to long long.

Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /home/janis/gcc_rsync/gcc-cvs/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.545
diff -u -p -r1.545 rs6000.c
--- gcc/config/rs6000/rs6000.c	6 Nov 2003 21:52:31 -0000	1.545
+++ gcc/config/rs6000/rs6000.c	8 Nov 2003 00:20:41 -0000
@@ -222,7 +222,7 @@ static void rs6000_frame_related (rtx, r
 static rtx spe_synthesize_frame_save (rtx);
 static bool spe_func_has_64bit_regs_p (void);
 static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int,
-			     int, int);
+			     int, long long);
 static rtx gen_frame_mem_offset (enum machine_mode, rtx, int);
 static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int);
 static unsigned rs6000_hash_constant (rtx);
@@ -10255,7 +10255,7 @@ rs6000_stack_info (void)
   rs6000_stack_t *info_ptr = &info;
   int reg_size = TARGET_POWERPC64 ? 8 : 4;
   int ehrd_size;
-  int total_raw_size;
+  long long total_raw_size;
 
   /* Zero all fields portably.  */
   info = zero_info;
@@ -10676,13 +10676,13 @@ debug_stack_info (rs6000_stack_t *info)
     fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset);
 
   if (info->total_size)
-    fprintf (stderr, "\ttotal_size          = %5d\n", info->total_size);
+    fprintf (stderr, "\ttotal_size          = %5lld\n", info->total_size);
 
   if (info->varargs_size)
     fprintf (stderr, "\tvarargs_size        = %5d\n", info->varargs_size);
 
   if (info->vars_size)
-    fprintf (stderr, "\tvars_size           = %5d\n", info->vars_size);
+    fprintf (stderr, "\tvars_size           = %5lld\n", info->vars_size);
 
   if (info->parm_size)
     fprintf (stderr, "\tparm_size           = %5d\n", info->parm_size);
@@ -11353,7 +11353,7 @@ generate_set_vrsave (rtx reg, rs6000_sta
 
 static void
 emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode, 
-		 unsigned int regno, int offset, int total_size)
+		 unsigned int regno, int offset, long long total_size)
 {
   rtx reg, offset_rtx, insn, mem, addr, int_rtx;
   rtx replacea, replaceb;
Index: gcc/config/rs6000/rs6000.h
===================================================================
RCS file: /home/janis/gcc_rsync/gcc-cvs/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.298
diff -u -p -r1.298 rs6000.h
--- gcc/config/rs6000/rs6000.h	6 Nov 2003 21:52:32 -0000	1.298
+++ gcc/config/rs6000/rs6000.h	8 Nov 2003 00:20:43 -0000
@@ -1515,7 +1515,7 @@ typedef struct rs6000_stack {
   int ehrd_offset;		/* offset to EH return data */
   int reg_size;			/* register size (4 or 8) */
   int varargs_size;		/* size to hold V.4 args passed in regs */
-  int vars_size;		/* variable save area size */
+  long long vars_size;		/* variable save area size */
   int parm_size;		/* outgoing parameter size */
   int save_size;		/* save area size */
   int fixed_size;		/* fixed size of stack frame */
@@ -1530,7 +1530,7 @@ typedef struct rs6000_stack {
   int spe_gp_size;		/* size of 64-bit GPR save size for SPE */
   int spe_padding_size;
   int toc_size;			/* size to hold TOC if not in save_size */
-  int total_size;		/* total bytes allocated for stack */
+  long long total_size;		/* total bytes allocated for stack */
   int spe_64bit_regs_used;
 } rs6000_stack_t;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]