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]

patch (c/cp/java/f): __builtin_va_arg


I'm reviving the __builtin_va_arg patch I was working on in April.

My current thought, as I'm watching this patch get larger, is to
go ahead and check in the basic support, without the stdarg.h
change to actually turn it on, while I finish converting all the
targets to use the new support.

This will, with a minimum of hassle, allow me to give a port
maintainer a relatively small patch and the new stdarg.h to 
find out if I've done the conversion right.

The vast majority of the new code is in builtins.c, but there are
a few tweeks needed to even java and fortran to get them to link,
since target files are now doing things with special types.

If there are no objections, I'll go ahead and put this in.


r~



	* builtins.c (expand_builtin_saveregs): Fix typo last change.
	(expand_builtin_next_arg): Accept ARGLIST not EXP.
	(std_expand_builtin_va_start): New function.
	(expand_builtin_va_start): New function.
	(get_varargs_alias_set): New function.
	(std_expand_builtin_va_arg): New function.
	(expand_builtin_va_arg): New function.
	(expand_builtin_va_end): New function.
	(expand_builtin): Call them.
	* c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list,
	__builtin_varargs_start, __builtin_stdarg_start, __builtin_va_end.
	(build_va_arg): New function.
	* c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete.
	(build_va_arg): Declare.
	* c-decl.c (ptr_type_node, va_list_type_node): New.
	* c-parse.gperf (__builtin_va_arg): New.
	* c-parse.in (VA_ARG): New token.
	(unary_expr): Recognize it.
	* expr.c (expand_expr): Expand VA_ARG_EXPR.
	* expr.h (std_expand_builtin_va_start): Declare.
	(std_expand_builtin_va_arg): Declare.
	(expand_builtin_va_arg): Declare.
	(get_varargs_alias_set): Declare.
	* tree.def (VA_ARG_EXPR): New.
	* tree.h (BUILT_IN_VARARGS_START): New.
	(BUILT_IN_STDARG_START, BUILT_IN_VA_END): New.
	(ptr_type_node, va_list_type_node): Declare.

	* emit-rtl.c (operand_subword): Copy alias set.
	(change_address): Likewise.

cp/
	* decl.c (ptr_type_node, va_list_type_node): New.
	* gxx.gperf (__builtin_va_arg): New.
	* parse.y (VA_ARG): New token.
	(unary_expr): Recognize it.

java/
	* decl.c (va_list_type_node): New.

f/
	* com.c (ptr_type_node, va_list_type_node): New.
	(ffecom_init_0): Init and use ptr_type_node.


Index: builtins.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/builtins.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 builtins.c
*** builtins.c	1999/07/22 11:04:58	1.1
--- builtins.c	1999/07/23 17:46:53
*************** static rtx expand_builtin_constant_p	PRO
*** 76,81 ****
--- 76,83 ----
  static rtx expand_builtin_saveregs	PROTO((tree, rtx, int));
  static rtx expand_builtin_args_info	PROTO((tree));
  static rtx expand_builtin_next_arg	PROTO((tree));
+ static rtx expand_builtin_va_start	PROTO((int, tree));
+ static rtx expand_builtin_va_end	PROTO((tree));
  static rtx expand_builtin_memcmp	PROTO((tree, tree, rtx));
  static rtx expand_builtin_strcmp	PROTO((tree, rtx));
  static rtx expand_builtin_memcpy	PROTO((tree));
*************** expand_builtin_saveregs (exp, target, ig
*** 1700,1706 ****
  
  #ifdef EXPAND_BUILTIN_SAVEREGS
      /* Do whatever the machine needs done in this case.  */
!     temp = EXPAND_BUILTIN_SAVEREGS (arglist);
  #else
      /* The register where the function returns its value
         is likely to have something else in it, such as an argument.
--- 1702,1708 ----
  
  #ifdef EXPAND_BUILTIN_SAVEREGS
      /* Do whatever the machine needs done in this case.  */
!     temp = EXPAND_BUILTIN_SAVEREGS (TREE_OPERAND (exp, 1));
  #else
      /* The register where the function returns its value
         is likely to have something else in it, such as an argument.
*************** expand_builtin_args_info (exp)
*** 1791,1802 ****
  #endif
  }
  
! /* Expand expression EXP, which is a call to __builtin_next_arg.  */
  static rtx
! expand_builtin_next_arg (exp)
!      tree exp;
  {
-   tree arglist = TREE_OPERAND (exp, 1);
    tree fntype = TREE_TYPE (current_function_decl);
  
    if ((TYPE_ARG_TYPES (fntype) == 0
--- 1793,1803 ----
  #endif
  }
  
! /* Expand ARGLIST, from a call to __builtin_next_arg.  */
  static rtx
! expand_builtin_next_arg (arglist)
!      tree arglist;
  {
    tree fntype = TREE_TYPE (current_function_decl);
  
    if ((TYPE_ARG_TYPES (fntype) == 0
*************** expand_builtin_next_arg (exp)
*** 1836,1841 ****
--- 1837,1979 ----
  		       NULL_RTX, 0, OPTAB_LIB_WIDEN);
  }
  
+ /* The "standard" implementation of va_start: just assign `nextarg' to
+    the variable.  */
+ void
+ std_expand_builtin_va_start (stdarg_p, valist, nextarg)
+      int stdarg_p ATTRIBUTE_UNUSED;
+      tree valist;
+      rtx nextarg;
+ {
+   tree t;
+ 
+   t = build (MODIFY_EXPR, TREE_TYPE (valist), valist,
+ 	     make_tree (ptr_type_node, nextarg));
+   TREE_SIDE_EFFECTS (t) = 1;
+ 
+   expand_expr (t, const0_rtx, VOIDmode, 0);
+ }
+ 
+ /* Expand ARGLIST, which from a call to __builtin_stdarg_va_start or
+    __builtin_varargs_va_start, depending on STDARG_P.  */
+ static rtx
+ expand_builtin_va_start (stdarg_p, arglist)
+      int stdarg_p;
+      tree arglist;
+ {
+   rtx nextarg;
+   tree chain = arglist;
+ 
+   if (stdarg_p)
+     nextarg = expand_builtin_next_arg (chain = TREE_CHAIN (arglist));
+   else
+     nextarg = expand_builtin_next_arg (NULL_TREE);
+ 
+   if (TREE_CHAIN (chain))
+     error ("too many arguments to function `va_start'");
+ 
+ #ifdef EXPAND_BUILTIN_VA_START
+   EXPAND_BUILTIN_VA_START (stdarg_p, TREE_VALUE (arglist), nextarg);
+ #else
+   std_expand_builtin_va_start (stdarg_p, TREE_VALUE (arglist), nextarg);
+ #endif
+ 
+   return const0_rtx;
+ }
+ 
+ /* Allocate an alias set for use in storing and reading from the varargs
+    spill area.  */
+ int
+ get_varargs_alias_set ()
+ {
+   static int set = -1;
+   if (set == -1)
+     set = new_alias_set ();
+   return set;
+ }
+ 
+ /* The "standard" implementation of va_arg: read the value from the
+    current (padded) address and increment by the (padded) size.  */
+ rtx
+ std_expand_builtin_va_arg (valist, type)
+      tree valist, type;
+ {
+   tree addr_tree, t;
+   HOST_WIDE_INT align;
+   HOST_WIDE_INT rounded_size;
+   rtx addr;
+ 
+   /* Compute the rounded size of the type.  */
+   align = PARM_BOUNDARY / BITS_PER_UNIT;
+   rounded_size = (((TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_UNIT
+ 		    + align - 1) / align) * align);
+ 
+   /* Get AP.  */
+   addr_tree = valist;
+   if (BYTES_BIG_ENDIAN)
+     {
+       /* Small args are padded downward.  */
+ 
+       HOST_WIDE_INT adj;
+       adj = TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_UNIT;
+       if (rounded_size > align)
+ 	adj = rounded_size;
+ 
+       addr_tree = build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree,
+ 			 build_int_2 (rounded_size - adj, 0));
+     }
+   addr = copy_to_reg (expand_expr (addr_tree, NULL_RTX, VOIDmode, 0));
+ 
+   /* Compute new value for AP.  */
+   t = build (MODIFY_EXPR, TREE_TYPE (valist), valist,
+ 	     build (PLUS_EXPR, TREE_TYPE (valist), valist,
+ 		    build_int_2 (rounded_size, 0)));
+   TREE_SIDE_EFFECTS (t) = 1;
+ 
+   expand_expr (t, const0_rtx, 0, OPTAB_LIB_WIDEN);
+ 
+   return addr;
+ }
+ 
+ /* Expand __builtin_va_arg, which is not really a builtin function, but
+    a very special sort of operator.  */
+ rtx
+ expand_builtin_va_arg (valist, type)
+      tree valist, type;
+ {
+   rtx addr, result;
+ 
+   if (TYPE_MAIN_VARIANT (TREE_TYPE (valist))
+       != TYPE_MAIN_VARIANT (va_list_type_node))
+     {
+       error ("first argument to `__builtin_va_arg' not of type `va_list'");
+       return const0_rtx;
+     }
+ 
+ #ifdef EXPAND_BUILTIN_VA_ARG
+   addr = EXPAND_BUILTIN_VA_ARG (valist, type);
+ #else
+   addr = std_expand_builtin_va_arg (valist, type);
+ #endif
+ 
+   result = gen_rtx_MEM (TYPE_MODE (type), addr);
+   MEM_ALIAS_SET (result) = get_varargs_alias_set ();
+ 
+   return result;
+ }
+ 
+ /* Expand ARGLIST, from a call to __builtin_va_end.  */
+ static rtx
+ expand_builtin_va_end (arglist)
+      tree arglist ATTRIBUTE_UNUSED;
+ {
+ #ifdef EXPAND_BUILTIN_VA_END
+   EXPAND_BUILTIN_VA_END(arglist);
+ #endif
+ 
+   return const0_rtx;
+ }
+ 
  /* Expand a call to one of the builtin functions __builtin_frame_address or
     __builtin_return_address.  */
  static rtx
*************** expand_builtin (exp, target, subtarget, 
*** 2038,2044 ****
  
        /* Return the address of the first anonymous stack arg.  */
      case BUILT_IN_NEXT_ARG:
!       return expand_builtin_next_arg (exp);
  
      case BUILT_IN_CLASSIFY_TYPE:
        return expand_builtin_classify_type (arglist);
--- 2176,2182 ----
  
        /* Return the address of the first anonymous stack arg.  */
      case BUILT_IN_NEXT_ARG:
!       return expand_builtin_next_arg (arglist);
  
      case BUILT_IN_CLASSIFY_TYPE:
        return expand_builtin_classify_type (arglist);
*************** expand_builtin (exp, target, subtarget, 
*** 2186,2191 ****
--- 2324,2335 ----
  				TREE_VALUE (TREE_CHAIN (arglist)),
  				TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))));
        return const0_rtx;
+     case BUILT_IN_VARARGS_START:
+       return expand_builtin_va_start (0, arglist);
+     case BUILT_IN_STDARG_START:
+       return expand_builtin_va_start (1, arglist);
+     case BUILT_IN_VA_END:
+       return expand_builtin_va_end (arglist);
  
      default:			/* just do library call, if unknown builtin */
        error ("built-in function `%s' not currently supported",
Index: c-common.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-common.c,v
retrieving revision 1.60
diff -c -p -d -r1.60 c-common.c
*** c-common.c	1999/07/20 19:13:01	1.60
--- c-common.c	1999/07/23 17:46:53
*************** c_common_nodes_and_builtins (cplus_mode,
*** 3435,3440 ****
--- 3435,3448 ----
    /* Either char* or void*.  */
    tree traditional_ptr_type_node;
  
+ #ifdef BUILD_VA_LIST_TYPE
+   BUILD_VA_LIST_TYPE(va_list_type_node);
+ #else
+   va_list_type_node = ptr_type_node;
+ #endif
+   pushdecl (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"),
+ 			va_list_type_node));
+ 
    endlink = void_list_node;
    int_endlink = tree_cons (NULL_TREE, integer_type_node, endlink);
    double_endlink = tree_cons (NULL_TREE, double_type_node, endlink);
*************** c_common_nodes_and_builtins (cplus_mode,
*** 3608,3613 ****
--- 3616,3643 ----
    builtin_function ("__builtin_return", void_ftype_ptr,
  		    BUILT_IN_RETURN, NULL_PTR);
  
+   /* Support for varargs.h and stdarg.h.  */
+   builtin_function ("__builtin_varargs_start",
+ 		    build_function_type (void_type_node,
+ 					 tree_cons (NULL_TREE,
+ 						    va_list_type_node,
+ 						    endlink)),
+ 		    BUILT_IN_VARARGS_START, NULL_PTR);
+ 
+   builtin_function ("__builtin_stdarg_start",
+ 		    build_function_type (void_type_node,
+ 					 tree_cons (NULL_TREE,
+ 						    va_list_type_node,
+ 						    NULL_TREE)),
+ 		    BUILT_IN_STDARG_START, NULL_PTR);
+ 
+   builtin_function ("__builtin_va_end",
+ 		    build_function_type (void_type_node,
+ 					 tree_cons (NULL_TREE,
+ 						    va_list_type_node,
+ 						    endlink)),
+ 		    BUILT_IN_VA_END, NULL_PTR);
+ 
    /* Currently under experimentation.  */
    builtin_function ("__builtin_memcpy", memcpy_ftype, BUILT_IN_MEMCPY,
  		    "memcpy");
*************** c_common_nodes_and_builtins (cplus_mode,
*** 3711,3714 ****
--- 3741,3751 ----
    builtin_function ("__builtin_getman", double_ftype_double, BUILT_IN_GETMAN,
  		    NULL_PTR);
  #endif
+ }
+ 
+ tree
+ build_va_arg (expr, type)
+      tree expr, type;
+ {
+   return build1 (VA_ARG_EXPR, type, expr);
  }
Index: c-common.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-common.h,v
retrieving revision 1.2
diff -c -p -d -r1.2 c-common.h
*** c-common.h	1999/07/20 10:40:39	1.2
--- c-common.h	1999/07/23 17:46:53
*************** enum c_tree_index
*** 63,69 ****
      CTI_STRING_TYPE,
      CTI_CONST_STRING_TYPE,
  
-     CTI_PTR_TYPE,
      CTI_CONST_PTR_TYPE,
      CTI_PTRDIFF_TYPE,
  
--- 63,68 ----
*************** extern tree c_global_trees[CTI_MAX];
*** 126,132 ****
  #define boolean_true_node		c_global_trees[CTI_BOOLEAN_TRUE]
  #define boolean_false_node		c_global_trees[CTI_BOOLEAN_FALSE]
  
- #define ptr_type_node			c_global_trees[CTI_PTR_TYPE]
  #define const_ptr_type_node		c_global_trees[CTI_CONST_PTR_TYPE]
  #define ptrdiff_type_node		c_global_trees[CTI_PTRDIFF_TYPE]
  
--- 125,130 ----
*************** extern tree builtin_function			PROTO((co
*** 190,192 ****
--- 188,192 ----
  /* Build tree nodes and builtin functions common to both C and C++ language
     frontends.  */
  extern void c_common_nodes_and_builtins		PROTO((int, int, int));
+ 
+ extern tree build_va_arg			PROTO((tree, tree));
Index: c-decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-decl.c,v
retrieving revision 1.63
diff -c -p -d -r1.63 c-decl.c
*** c-decl.c	1999/07/20 10:40:39	1.63
--- c-decl.c	1999/07/23 17:46:54
*************** tree char_type_node;
*** 119,124 ****
--- 119,130 ----
  tree integer_type_node;
  tree unsigned_type_node;
  
+ /* These can't be part of the above array, since they are declared
+    individially in tree.h and used by the target routines.  */
+ 
+ tree ptr_type_node;
+ tree va_list_type_node;
+ 
  /* Two expressions that are constants with value zero.
     The first is of type `int', the second of type `void *'.  */
  
Index: c-parse.gperf
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-parse.gperf,v
retrieving revision 1.7
diff -c -p -d -r1.7 c-parse.gperf
*** c-parse.gperf	1999/03/31 07:43:51	1.7
--- c-parse.gperf	1999/07/23 17:46:54
*************** __asm, ASM_KEYWORD, NORID
*** 21,26 ****
--- 21,27 ----
  __asm__, ASM_KEYWORD, NORID
  __attribute, ATTRIBUTE, NORID
  __attribute__, ATTRIBUTE, NORID
+ __builtin_va_arg, VA_ARG, NORID
  __complex, TYPESPEC, RID_COMPLEX
  __complex__, TYPESPEC, RID_COMPLEX
  __const, TYPE_QUAL, RID_CONST
Index: c-parse.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-parse.in,v
retrieving revision 1.16
diff -c -p -d -r1.16 c-parse.in
*** c-parse.in	1999/04/26 22:35:50	1.16
--- c-parse.in	1999/07/23 17:46:54
*************** end ifc
*** 136,142 ****
  %token SIZEOF ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
  %token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
  %token ATTRIBUTE EXTENSION LABEL
! %token REALPART IMAGPART
  
  /* Add precedence rules to solve dangling else s/r conflict */
  %nonassoc IF
--- 136,142 ----
  %token SIZEOF ENUM STRUCT UNION IF ELSE WHILE DO FOR SWITCH CASE DEFAULT
  %token BREAK CONTINUE RETURN GOTO ASM_KEYWORD TYPEOF ALIGNOF
  %token ATTRIBUTE EXTENSION LABEL
! %token REALPART IMAGPART VA_ARG
  
  /* Add precedence rules to solve dangling else s/r conflict */
  %nonassoc IF
*************** unary_expr:
*** 500,505 ****
--- 500,507 ----
  		{ $$ = build_unary_op (REALPART_EXPR, $2, 0); }
  	| IMAGPART cast_expr %prec UNARY
  		{ $$ = build_unary_op (IMAGPART_EXPR, $2, 0); }
+ 	| VA_ARG '(' expr_no_commas ',' typename ')'
+ 		{ $$ = build_va_arg ($3, groktypename ($5)); }
  	;
  
  sizeof:
Index: emit-rtl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/emit-rtl.c,v
retrieving revision 1.63
diff -c -p -d -r1.63 emit-rtl.c
*** emit-rtl.c	1999/07/23 01:21:31	1.63
--- emit-rtl.c	1999/07/23 17:46:54
*************** operand_subword (op, i, validate_address
*** 1296,1301 ****
--- 1296,1302 ----
  
        MEM_COPY_ATTRIBUTES (new, op);
        RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (op);
+       MEM_ALIAS_SET (new) = MEM_ALIAS_SET (op);
  
        return new;
      }
*************** change_address (memref, mode, addr)
*** 1598,1603 ****
--- 1599,1605 ----
    new = gen_rtx_MEM (mode, addr);
    RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (memref);
    MEM_COPY_ATTRIBUTES (new, memref);
+   MEM_ALIAS_SET (new) = MEM_ALIAS_SET (memref);
    return new;
  }
  
Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.155
diff -c -p -d -r1.155 expr.c
*** expr.c	1999/07/22 11:04:50	1.155
--- expr.c	1999/07/23 17:46:55
*************** expand_expr (exp, target, tmode, modifie
*** 8240,8245 ****
--- 8240,8248 ----
  	return const0_rtx;
        }
  
+     case VA_ARG_EXPR:
+       return expand_builtin_va_arg (TREE_OPERAND (exp, 0), type);
+ 
      default:
        return (*lang_expand_expr) (exp, original_target, tmode, modifier);
      }
Index: expr.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.h,v
retrieving revision 1.37
diff -c -p -d -r1.37 expr.h
*** expr.h	1999/07/22 11:04:51	1.37
--- expr.h	1999/07/23 17:46:55
*************** extern rtx gen_cond_trap PROTO((enum rtx
*** 738,746 ****
--- 738,750 ----
  /* Functions from builtins.c:  */
  #ifdef TREE_CODE
  extern rtx expand_builtin PROTO((tree, rtx, rtx, enum machine_mode, int));
+ extern void std_expand_builtin_va_start PROTO((int, tree, rtx));
+ extern rtx std_expand_builtin_va_arg PROTO((tree, tree));
+ extern rtx expand_builtin_va_arg PROTO((tree, tree));
  #endif
  
  extern rtx expand_builtin_setjmp PROTO((rtx, rtx, rtx, rtx));
+ extern int get_varargs_alias_set PROTO((void));
  
  /* Functions from expr.c:  */
  
Index: tree.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.def,v
retrieving revision 1.21
diff -c -p -d -r1.21 tree.def
*** tree.def	1999/05/17 07:21:12	1.21
--- tree.def	1999/07/23 17:46:55
*************** DEFTREECODE (PREINCREMENT_EXPR, "preincr
*** 701,706 ****
--- 701,709 ----
  DEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", 'e', 2)
  DEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", 'e', 2)
  
+ /* Used to implement `va_arg'.  */
+ DEFTREECODE (VA_ARG_EXPR, "va_arg_expr", 'e', 1)
+ 
  /* Evaluate operand 1.  If and only if an exception is thrown during
     the evaluation of operand 1, evaluate operand 2.
  
Index: tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.h,v
retrieving revision 1.71
diff -c -p -d -r1.71 tree.h
*** tree.h	1999/05/02 17:43:32	1.71
--- tree.h	1999/07/23 17:46:55
*************** enum built_in_function
*** 117,122 ****
--- 117,126 ----
    BUILT_IN_EXTRACT_RETURN_ADDR,
    BUILT_IN_EH_RETURN,
  
+   BUILT_IN_VARARGS_START,
+   BUILT_IN_STDARG_START,
+   BUILT_IN_VA_END,
+ 
    /* C++ extensions */
    BUILT_IN_NEW,
    BUILT_IN_VEC_NEW,
*************** extern tree unsigned_type_node;
*** 1854,1859 ****
--- 1858,1868 ----
  /* The type node for the ordinary character type.  */
  extern tree char_type_node;
  
+ extern tree ptr_type_node;
+ 
+ /* Type `va_list'.  Used by va_start, va_arg, etc.  */
+ extern tree va_list_type_node;
+ 
  /* Points to the name of the input file from which the current input
     being parsed originally came (before it went into cpp).  */
  extern char *input_filename;
Index: cp/decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.382
diff -c -p -d -r1.382 decl.c
*** decl.c	1999/07/21 08:52:13	1.382
--- decl.c	1999/07/23 17:47:16
*************** tree char_type_node;
*** 275,280 ****
--- 275,286 ----
  tree integer_type_node;
  tree unsigned_type_node;
  
+ /* These can't be part of the above array, since they are declared
+    individially in tree.h and used by the target routines.  */
+ 
+ tree ptr_type_node;
+ tree va_list_type_node;
+ 
  /* Indicates that there is a type value in some namespace, although
     that is not necessarily in scope at the moment.  */
  
Index: cp/gxx.gperf
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/gxx.gperf,v
retrieving revision 1.9
diff -c -p -d -r1.9 gxx.gperf
*** gxx.gperf	1999/05/21 15:55:50	1.9
--- gxx.gperf	1999/07/23 17:47:16
*************** __asm, ASM_KEYWORD, RID_UNUSED
*** 9,14 ****
--- 9,15 ----
  __asm__, ASM_KEYWORD, RID_UNUSED
  __attribute, ATTRIBUTE, RID_UNUSED
  __attribute__, ATTRIBUTE, RID_UNUSED
+ __builtin_va_arg, VA_ARG, RID_UNUSED
  __complex, TYPESPEC, RID_COMPLEX
  __complex__, TYPESPEC, RID_COMPLEX
  __const, CV_QUALIFIER, RID_CONST
Index: cp/parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/parse.y,v
retrieving revision 1.125
diff -c -p -d -r1.125 parse.y
*** parse.y	1999/07/20 19:53:38	1.125
--- parse.y	1999/07/23 17:47:17
*************** empty_parms ()
*** 133,139 ****
  %token BREAK CONTINUE RETURN_KEYWORD GOTO ASM_KEYWORD TYPEOF ALIGNOF
  %token SIGOF
  %token ATTRIBUTE EXTENSION LABEL
! %token REALPART IMAGPART
  
  /* the reserved words... C++ extensions */
  %token <ttype> AGGR
--- 133,139 ----
  %token BREAK CONTINUE RETURN_KEYWORD GOTO ASM_KEYWORD TYPEOF ALIGNOF
  %token SIGOF
  %token ATTRIBUTE EXTENSION LABEL
! %token REALPART IMAGPART VA_ARG
  
  /* the reserved words... C++ extensions */
  %token <ttype> AGGR
*************** unary_expr:
*** 1162,1167 ****
--- 1162,1170 ----
  		{ $$ = build_x_unary_op (REALPART_EXPR, $2); }
  	| IMAGPART cast_expr %prec UNARY
  		{ $$ = build_x_unary_op (IMAGPART_EXPR, $2); }
+ 	| VA_ARG '(' expr_no_commas ',' type_id ')'
+ 		{ $$ = build_va_arg ($3, groktypename ($5.t));
+ 		  check_for_new_type ("__builtin_va_arg", $5); }
  	;
  
          /* Note this rule is not suitable for use in new_placement
Index: java/decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/java/decl.c,v
retrieving revision 1.32
diff -c -p -d -r1.32 decl.c
*** decl.c	1999/07/21 14:28:33	1.32
--- decl.c	1999/07/23 17:47:17
*************** tree soft_irem_node;
*** 370,375 ****
--- 370,377 ----
  tree soft_ldiv_node;
  tree soft_lrem_node;
  
+ /* __builtin_va_list; unused by java, but referenced by target files.  */
+ tree va_list_type_node;
  
  /* Build (and pushdecl) a "promoted type" for all standard
     types shorter than int.  */
Index: f/com.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/f/com.c,v
retrieving revision 1.62
diff -c -p -d -r1.62 com.c
*** com.c	1999/06/28 18:43:47	1.62
--- com.c	1999/07/23 17:47:17
*************** tree integer_type_node;
*** 228,233 ****
--- 228,235 ----
  tree unsigned_type_node;
  tree char_type_node;
  tree current_function_decl;
+ tree ptr_type_node;
+ tree va_list_type_node;
  
  /* ~~gcc/tree.h *should* declare this, because toplev.c and dwarfout.c
     reference it.  */
*************** ffecom_init_0 ()
*** 11807,11814 ****
       so we might as well not have any types that claim to have it.  */
    TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
  
    null_pointer_node = build_int_2 (0, 0);
!   TREE_TYPE (null_pointer_node) = build_pointer_type (void_type_node);
    layout_type (TREE_TYPE (null_pointer_node));
  
    string_type_node = build_pointer_type (char_type_node);
--- 11809,11818 ----
       so we might as well not have any types that claim to have it.  */
    TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
  
+   ptr_type_node = build_pointer_type (void_type_node);
+ 
    null_pointer_node = build_int_2 (0, 0);
!   TREE_TYPE (null_pointer_node) = ptr_type_node;
    layout_type (TREE_TYPE (null_pointer_node));
  
    string_type_node = build_pointer_type (char_type_node);


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