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]: Kill space wated in every sparc stack frame


In ancient days, reload couldn't handle generating secondary and
tertiary reloads for long doubles going between general and float
register on sparc if the address were not offsetable.

It certainly can these days.  There are tests in the gfortran
testsuite which exercise this case and they pass with this patch
applied.

So this fixed (and %99.99999 of the time) wasted space in every sparc
stack frame can be reclaimed.

Bootstraped/regtested on sparc-linux-gnu and sparc64-linux-gnu.

Applied to mainline.

2009-01-04  David S. Miller  <davem@davemloft.net>

	* config/sparc/sparc.h (SECONDARY_MEMORY_NEEDED_RTX): Delete.
	(STARTING_FRAME_OFFSET): Always set to zero.

Index: gcc/config/sparc/sparc.h
===================================================================
--- gcc/config/sparc/sparc.h	(revision 143068)
+++ gcc/config/sparc/sparc.h	(working copy)
@@ -1317,16 +1317,6 @@
 #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
   (FP_REG_CLASS_P (CLASS1) != FP_REG_CLASS_P (CLASS2))
 
-/* Return the stack location to use for secondary memory needed reloads.
-   We want to use the reserved location just below the frame pointer.
-   However, we must ensure that there is a frame, so use assign_stack_local
-   if the frame size is zero.  */
-#define SECONDARY_MEMORY_NEEDED_RTX(MODE) \
-  (get_frame_size () == 0						\
-   ? assign_stack_local (MODE, GET_MODE_SIZE (MODE), 0)			\
-   : gen_rtx_MEM (MODE, plus_constant (frame_pointer_rtx,		\
-				       STARTING_FRAME_OFFSET)))
-
 /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on v9
    because the movsi and movsf patterns don't handle r/f moves.
    For v8 we copy the default definition.  */
@@ -1362,11 +1352,7 @@
    If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
    first local allocated.  Otherwise, it is the offset to the BEGINNING
    of the first local allocated.  */
-/* This allows space for one TFmode floating point value, which is used
-   by SECONDARY_MEMORY_NEEDED_RTX.  */
-#define STARTING_FRAME_OFFSET \
-  (TARGET_ARCH64 ? -16 \
-   : (-SPARC_STACK_ALIGN (LONG_DOUBLE_TYPE_SIZE / BITS_PER_UNIT)))
+#define STARTING_FRAME_OFFSET 0
 
 /* Offset of first parameter from the argument pointer register value.
    !v9: This is 64 for the ins and locals, plus 4 for the struct-return reg


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