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]

execute/20020307-2.c, part 3


        * expr.h (ADD_PARM_SIZE): Cast INC to ssizetype.
        (SUB_PARM_SIZE): Cast DEC to ssizetype.

        * config/alpha/alpha.c (alpha_va_arg): Read MUST_PASS_IN_STACK
        types from the normal argument frame.

Index: expr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.h,v
retrieving revision 1.110
diff -c -p -d -r1.110 expr.h
*** expr.h	2002/02/21 21:10:55	1.110
--- expr.h	2002/03/26 01:18:51
*************** struct args_size
*** 75,97 ****
  
  /* Add the value of the tree INC to the `struct args_size' TO.  */
  
! #define ADD_PARM_SIZE(TO, INC)	\
! { tree inc = (INC);				\
!   if (host_integerp (inc, 0))			\
!     (TO).constant += tree_low_cst (inc, 0);	\
!   else if ((TO).var == 0)			\
!     (TO).var = inc;				\
!   else						\
!     (TO).var = size_binop (PLUS_EXPR, (TO).var, inc); }
  
! #define SUB_PARM_SIZE(TO, DEC)	\
! { tree dec = (DEC);				\
!   if (host_integerp (dec, 0))			\
!     (TO).constant -= tree_low_cst (dec, 0);	\
!   else if ((TO).var == 0)			\
!     (TO).var = size_binop (MINUS_EXPR, ssize_int (0), dec); \
!   else						\
!     (TO).var = size_binop (MINUS_EXPR, (TO).var, dec); }
  
  /* Convert the implicit sum in a `struct args_size' into a tree
     of type ssizetype.  */
--- 75,104 ----
  
  /* Add the value of the tree INC to the `struct args_size' TO.  */
  
! #define ADD_PARM_SIZE(TO, INC)				\
! do {							\
!   tree inc = (INC);					\
!   if (host_integerp (inc, 0))				\
!     (TO).constant += tree_low_cst (inc, 0);		\
!   else if ((TO).var == 0)				\
!     (TO).var = inc;					\
!   else							\
!     (TO).var = size_binop (PLUS_EXPR, (TO).var,		\
! 			   convert (ssizetype, inc));	\
! } while (0)
  
! #define SUB_PARM_SIZE(TO, DEC)				\
! do {							\
!   tree dec = (DEC);					\
!   if (host_integerp (dec, 0))				\
!     (TO).constant -= tree_low_cst (dec, 0);		\
!   else if ((TO).var == 0)				\
!     (TO).var = size_binop (MINUS_EXPR, ssize_int (0),	\
! 			   convert (ssizetype, dec));	\
!   else							\
!     (TO).var = size_binop (MINUS_EXPR, (TO).var,	\
! 			   convert (ssizetype, dec));	\
! } while (0)
  
  /* Convert the implicit sum in a `struct args_size' into a tree
     of type ssizetype.  */
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.238
diff -c -p -d -r1.238 alpha.c
*** config/alpha/alpha.c	2002/03/18 03:06:05	1.238
--- config/alpha/alpha.c	2002/03/26 01:18:51
*************** alpha_va_arg (valist, type)
*** 5812,5817 ****
--- 5812,5828 ----
    offset_field = build (COMPONENT_REF, TREE_TYPE (offset_field),
  			valist, offset_field);
  
+   /* If the type could not be passed in registers, skip the block
+      reserved for the registers.  */
+   if (MUST_PASS_IN_STACK (TYPE_MODE (type), type))
+     {
+       t = build (MODIFY_EXPR, TREE_TYPE (offset_field), offset_field,
+ 		 build (MAX_EXPR, TREE_TYPE (offset_field), 
+ 			offset_field, build_int_2 (6*8, 0)));
+       TREE_SIDE_EFFECTS (t) = 1;
+       expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+     }
+ 
    wide_type = make_signed_type (64);
    wide_ofs = save_expr (build1 (CONVERT_EXPR, wide_type, offset_field));
  


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