stack layout code for c4x

Herman ten Brugge Haj.Ten.Brugge@net.HCC.nl
Sun Oct 4 08:12:00 GMT 1998


Hello,

The c4x has a stack layout that is not currently supported by gcc. I did check
all other targets and made a table how things are defined. The table is below.
The c4x has not defined STACK_GROWS_DOWNWARD and ARGS_GROW_DOWNWARD is defined
and PUSH_ROUNDING is not defined. So I tested for this condition in the
push_block code. After this patch the gcc port of c4x generates the same
stack layout code as the TI compiler.

	Herman.

defined STACK_GROWS_DOWNWARD
 1750a a29k alpha arc arm clipper convex elxsi fx80 gmicro
 h8300 i386 i860 m32r m68k m88k mips mn10200 mn10300
 ns32k pdp11 pyr romp rs6000 sh sparc spur tahoe v850 vax

!defined (STACK_GROWS_DOWNWARD)
          ARGS_GROW_DOWNWARD    PUSH_ROUNDING
 c4x      defined               undef	
 dsp16xx  defined               undef
 i370     undef                 undef
 i960     undef                 undef
 pa       defined               undef
 we32k    undef                 defined

special
 msdos winnt


1998-10-04 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
	
	* expr.c (push_block) fix stack layout code for c4x.

--- expr.c.org	Sat Oct  3 21:04:40 1998
+++ expr.c	Sun Oct  4 14:26:27 1998
@@ -2598,7 +2598,10 @@ push_block (size, extra, below)
       anti_adjust_stack (temp);
     }
 
-#ifdef STACK_GROWS_DOWNWARD
+#if defined (STACK_GROWS_DOWNWARD) \
+    || (!defined (STACK_GROWS_DOWNWARD) \
+	&& defined (ARGS_GROW_DOWNWARD) \
+	&& !defined (PUSH_ROUNDING))
   temp = virtual_outgoing_args_rtx;
   if (extra != 0 && below)
     temp = plus_constant (temp, extra);

-- 
-------------------------------------------------------------------------
Herman ten Brugge			Email:	Haj.Ten.Brugge@net.HCC.nl



More information about the Gcc-patches mailing list