Commit b64fca63 by Nathan Froyd Committed by Nathan Froyd

tree.c (build_function_type_list_1): Remove bogus assert condition.

gcc/
	* tree.c (build_function_type_list_1): Remove bogus assert condition.

gcc/fortran/
	* trans-types.c (gfc_init_types): Use build_function_type_list.
	(gfc_get_ppc_type): Likewise.
	* trans-decl.c (gfc_generate_constructors): Likewise.
	* f95-lang.c (build_builtin_fntypes): Likewise.
	(gfc_init_builtin_functions): Likewise.
	(DEF_FUNCTION_TYPE_0): Likewise.
	(DEF_FUNCTION_TYPE_1): Likewise.
	(DEF_FUNCTION_TYPE_2): Likewise.
	(DEF_FUNCTION_TYPE_3): Likewise.
	(DEF_FUNCTION_TYPE_4): Likewise.
	(DEF_FUNCTION_TYPE_5): Likewise.
	(DEF_FUNCTION_TYPE_6): Likewise.
	(DEF_FUNCTION_TYPE_7): Likewise.  Use ARG7.
	(DEF_FUNCTION_TYPE_VAR_0): Use build_varags_function_type_list.

From-SVN: r159491
parent 8748ad99
2010-05-17 Nathan Froyd <froydnj@codesourcery.com>
* tree.c (build_function_type_list_1): Remove bogus assert condition.
2010-05-17 Alan Modra <amodra@gmail.com> 2010-05-17 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Delete
......
2010-05-17 Nathan Froyd <froydnj@codesourcery.com
* trans-types.c (gfc_init_types): Use build_function_type_list.
(gfc_get_ppc_type): Likewise.
* trans-decl.c (gfc_generate_constructors): Likewise.
* f95-lang.c (build_builtin_fntypes): Likewise.
(gfc_init_builtin_functions): Likewise.
(DEF_FUNCTION_TYPE_0): Likewise.
(DEF_FUNCTION_TYPE_1): Likewise.
(DEF_FUNCTION_TYPE_2): Likewise.
(DEF_FUNCTION_TYPE_3): Likewise.
(DEF_FUNCTION_TYPE_4): Likewise.
(DEF_FUNCTION_TYPE_5): Likewise.
(DEF_FUNCTION_TYPE_6): Likewise.
(DEF_FUNCTION_TYPE_7): Likewise. Use ARG7.
(DEF_FUNCTION_TYPE_VAR_0): Use build_varags_function_type_list.
2010-05-17 Nathan Froyd <froydnj@cs.rice.edu> 2010-05-17 Nathan Froyd <froydnj@cs.rice.edu>
* trans-array.c (gfc_trans_array_constructor_value): Use * trans-array.c (gfc_trans_array_constructor_value): Use
......
...@@ -636,28 +636,23 @@ gfc_define_builtin (const char *name, ...@@ -636,28 +636,23 @@ gfc_define_builtin (const char *name,
static void static void
build_builtin_fntypes (tree *fntype, tree type) build_builtin_fntypes (tree *fntype, tree type)
{ {
tree tmp;
/* type (*) (type) */ /* type (*) (type) */
tmp = tree_cons (NULL_TREE, type, void_list_node); fntype[0] = build_function_type_list (type, type, NULL_TREE);
fntype[0] = build_function_type (type, tmp);
/* type (*) (type, type) */ /* type (*) (type, type) */
tmp = tree_cons (NULL_TREE, type, tmp); fntype[1] = build_function_type_list (type, type, type, NULL_TREE);
fntype[1] = build_function_type (type, tmp);
/* type (*) (int, type) */
tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
tmp = tree_cons (NULL_TREE, type, tmp);
fntype[2] = build_function_type (type, tmp);
/* type (*) (void) */
fntype[3] = build_function_type (type, void_list_node);
/* type (*) (type, &int) */
tmp = tree_cons (NULL_TREE, type, void_list_node);
tmp = tree_cons (NULL_TREE, build_pointer_type (integer_type_node), tmp);
fntype[4] = build_function_type (type, tmp);
/* type (*) (type, int) */ /* type (*) (type, int) */
tmp = tree_cons (NULL_TREE, type, void_list_node); fntype[2] = build_function_type_list (type,
tmp = tree_cons (NULL_TREE, integer_type_node, tmp); type, integer_type_node, NULL_TREE);
fntype[5] = build_function_type (type, tmp); /* type (*) (void) */
fntype[3] = build_function_type_list (type, NULL_TREE);
/* type (*) (&int, type) */
fntype[4] = build_function_type_list (type,
build_pointer_type (integer_type_node),
type,
NULL_TREE);
/* type (*) (int, type) */
fntype[5] = build_function_type_list (type,
integer_type_node, type, NULL_TREE);
} }
...@@ -721,7 +716,6 @@ gfc_init_builtin_functions (void) ...@@ -721,7 +716,6 @@ gfc_init_builtin_functions (void)
tree func_double_doublep_doublep; tree func_double_doublep_doublep;
tree func_longdouble_longdoublep_longdoublep; tree func_longdouble_longdoublep_longdoublep;
tree ftype, ptype; tree ftype, ptype;
tree tmp, type;
tree builtin_types[(int) BT_LAST + 1]; tree builtin_types[(int) BT_LAST + 1];
build_builtin_fntypes (mfunc_float, float_type_node); build_builtin_fntypes (mfunc_float, float_type_node);
...@@ -731,46 +725,39 @@ gfc_init_builtin_functions (void) ...@@ -731,46 +725,39 @@ gfc_init_builtin_functions (void)
build_builtin_fntypes (mfunc_cdouble, complex_double_type_node); build_builtin_fntypes (mfunc_cdouble, complex_double_type_node);
build_builtin_fntypes (mfunc_clongdouble, complex_long_double_type_node); build_builtin_fntypes (mfunc_clongdouble, complex_long_double_type_node);
tmp = tree_cons (NULL_TREE, complex_float_type_node, void_list_node); func_cfloat_float = build_function_type_list (float_type_node,
func_cfloat_float = build_function_type (float_type_node, tmp); complex_float_type_node,
NULL_TREE);
tmp = tree_cons (NULL_TREE, float_type_node, void_list_node); func_float_cfloat = build_function_type_list (complex_float_type_node,
func_float_cfloat = build_function_type (complex_float_type_node, tmp); float_type_node, NULL_TREE);
tmp = tree_cons (NULL_TREE, complex_double_type_node, void_list_node); func_cdouble_double = build_function_type_list (double_type_node,
func_cdouble_double = build_function_type (double_type_node, tmp); complex_double_type_node,
NULL_TREE);
tmp = tree_cons (NULL_TREE, double_type_node, void_list_node); func_double_cdouble = build_function_type_list (complex_double_type_node,
func_double_cdouble = build_function_type (complex_double_type_node, tmp); double_type_node, NULL_TREE);
tmp = tree_cons (NULL_TREE, complex_long_double_type_node, void_list_node);
func_clongdouble_longdouble = func_clongdouble_longdouble =
build_function_type (long_double_type_node, tmp); build_function_type_list (long_double_type_node,
complex_long_double_type_node, NULL_TREE);
tmp = tree_cons (NULL_TREE, long_double_type_node, void_list_node);
func_longdouble_clongdouble = func_longdouble_clongdouble =
build_function_type (complex_long_double_type_node, tmp); build_function_type_list (complex_long_double_type_node,
long_double_type_node, NULL_TREE);
ptype = build_pointer_type (float_type_node); ptype = build_pointer_type (float_type_node);
tmp = tree_cons (NULL_TREE, float_type_node,
tree_cons (NULL_TREE, ptype,
tree_cons (NULL_TREE, ptype, void_list_node)));
func_float_floatp_floatp = func_float_floatp_floatp =
build_function_type (void_type_node, tmp); build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
ptype = build_pointer_type (double_type_node); ptype = build_pointer_type (double_type_node);
tmp = tree_cons (NULL_TREE, double_type_node,
tree_cons (NULL_TREE, ptype,
tree_cons (NULL_TREE, ptype, void_list_node)));
func_double_doublep_doublep = func_double_doublep_doublep =
build_function_type (void_type_node, tmp); build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
ptype = build_pointer_type (long_double_type_node); ptype = build_pointer_type (long_double_type_node);
tmp = tree_cons (NULL_TREE, long_double_type_node,
tree_cons (NULL_TREE, ptype,
tree_cons (NULL_TREE, ptype, void_list_node)));
func_longdouble_longdoublep_longdoublep = func_longdouble_longdoublep_longdoublep =
build_function_type (void_type_node, tmp); build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
#include "mathbuiltins.def" #include "mathbuiltins.def"
...@@ -847,28 +834,31 @@ gfc_init_builtin_functions (void) ...@@ -847,28 +834,31 @@ gfc_init_builtin_functions (void)
BUILT_IN_HUGE_VALF, "__builtin_huge_valf", true); BUILT_IN_HUGE_VALF, "__builtin_huge_valf", true);
/* lround{f,,l} and llround{f,,l} */ /* lround{f,,l} and llround{f,,l} */
type = tree_cons (NULL_TREE, float_type_node, void_list_node); ftype = build_function_type_list (long_integer_type_node,
tmp = build_function_type (long_integer_type_node, type); float_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lroundf", tmp, BUILT_IN_LROUNDF, gfc_define_builtin ("__builtin_lroundf", ftype, BUILT_IN_LROUNDF,
"lroundf", true); "lroundf", true);
tmp = build_function_type (long_long_integer_type_node, type); ftype = build_function_type_list (long_long_integer_type_node,
gfc_define_builtin ("__builtin_llroundf", tmp, BUILT_IN_LLROUNDF, float_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_llroundf", ftype, BUILT_IN_LLROUNDF,
"llroundf", true); "llroundf", true);
type = tree_cons (NULL_TREE, double_type_node, void_list_node); ftype = build_function_type_list (long_integer_type_node,
tmp = build_function_type (long_integer_type_node, type); double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lround", tmp, BUILT_IN_LROUND, gfc_define_builtin ("__builtin_lround", ftype, BUILT_IN_LROUND,
"lround", true); "lround", true);
tmp = build_function_type (long_long_integer_type_node, type); ftype = build_function_type_list (long_long_integer_type_node,
gfc_define_builtin ("__builtin_llround", tmp, BUILT_IN_LLROUND, double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_llround", ftype, BUILT_IN_LLROUND,
"llround", true); "llround", true);
type = tree_cons (NULL_TREE, long_double_type_node, void_list_node); ftype = build_function_type_list (long_integer_type_node,
tmp = build_function_type (long_integer_type_node, type); long_double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_lroundl", tmp, BUILT_IN_LROUNDL, gfc_define_builtin ("__builtin_lroundl", ftype, BUILT_IN_LROUNDL,
"lroundl", true); "lroundl", true);
tmp = build_function_type (long_long_integer_type_node, type); ftype = build_function_type_list (long_long_integer_type_node,
gfc_define_builtin ("__builtin_llroundl", tmp, BUILT_IN_LLROUNDL, long_double_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_llroundl", ftype, BUILT_IN_LLROUNDL,
"llroundl", true); "llroundl", true);
/* These are used to implement the ** operator. */ /* These are used to implement the ** operator. */
...@@ -920,63 +910,54 @@ gfc_init_builtin_functions (void) ...@@ -920,63 +910,54 @@ gfc_init_builtin_functions (void)
} }
/* For LEADZ / TRAILZ. */ /* For LEADZ / TRAILZ. */
tmp = tree_cons (NULL_TREE, unsigned_type_node, void_list_node); ftype = build_function_type_list (integer_type_node,
ftype = build_function_type (integer_type_node, tmp); unsigned_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ, gfc_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ,
"__builtin_clz", true); "__builtin_clz", true);
tmp = tree_cons (NULL_TREE, long_unsigned_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
gfc_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL,
"__builtin_clzl", true);
tmp = tree_cons (NULL_TREE, long_long_unsigned_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
gfc_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL,
"__builtin_clzll", true);
tmp = tree_cons (NULL_TREE, unsigned_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
gfc_define_builtin ("__builtin_ctz", ftype, BUILT_IN_CTZ, gfc_define_builtin ("__builtin_ctz", ftype, BUILT_IN_CTZ,
"__builtin_ctz", true); "__builtin_ctz", true);
tmp = tree_cons (NULL_TREE, long_unsigned_type_node, void_list_node); ftype = build_function_type_list (integer_type_node,
ftype = build_function_type (integer_type_node, tmp); long_unsigned_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL,
"__builtin_clzl", true);
gfc_define_builtin ("__builtin_ctzl", ftype, BUILT_IN_CTZL, gfc_define_builtin ("__builtin_ctzl", ftype, BUILT_IN_CTZL,
"__builtin_ctzl", true); "__builtin_ctzl", true);
tmp = tree_cons (NULL_TREE, long_long_unsigned_type_node, void_list_node); ftype = build_function_type_list (integer_type_node,
ftype = build_function_type (integer_type_node, tmp); long_long_unsigned_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL,
"__builtin_clzll", true);
gfc_define_builtin ("__builtin_ctzll", ftype, BUILT_IN_CTZLL, gfc_define_builtin ("__builtin_ctzll", ftype, BUILT_IN_CTZLL,
"__builtin_ctzll", true); "__builtin_ctzll", true);
/* Other builtin functions we use. */ /* Other builtin functions we use. */
tmp = tree_cons (NULL_TREE, long_integer_type_node, void_list_node); ftype = build_function_type_list (long_integer_type_node,
tmp = tree_cons (NULL_TREE, long_integer_type_node, tmp); long_integer_type_node,
ftype = build_function_type (long_integer_type_node, tmp); long_integer_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT, gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
"__builtin_expect", true); "__builtin_expect", true);
tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node); ftype = build_function_type_list (void_type_node,
ftype = build_function_type (void_type_node, tmp); pvoid_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_free", ftype, BUILT_IN_FREE, gfc_define_builtin ("__builtin_free", ftype, BUILT_IN_FREE,
"free", false); "free", false);
tmp = tree_cons (NULL_TREE, size_type_node, void_list_node); ftype = build_function_type_list (pvoid_type_node,
ftype = build_function_type (pvoid_type_node, tmp); size_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_malloc", ftype, BUILT_IN_MALLOC, gfc_define_builtin ("__builtin_malloc", ftype, BUILT_IN_MALLOC,
"malloc", false); "malloc", false);
DECL_IS_MALLOC (built_in_decls[BUILT_IN_MALLOC]) = 1; DECL_IS_MALLOC (built_in_decls[BUILT_IN_MALLOC]) = 1;
tmp = tree_cons (NULL_TREE, pvoid_type_node, void_list_node); ftype = build_function_type_list (pvoid_type_node,
tmp = tree_cons (NULL_TREE, size_type_node, tmp); size_type_node, pvoid_type_node,
ftype = build_function_type (pvoid_type_node, tmp); NULL_TREE);
gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC, gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC,
"realloc", false); "realloc", false);
tmp = tree_cons (NULL_TREE, void_type_node, void_list_node); ftype = build_function_type_list (integer_type_node,
ftype = build_function_type (integer_type_node, tmp); void_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_isnan", ftype, BUILT_IN_ISNAN, gfc_define_builtin ("__builtin_isnan", ftype, BUILT_IN_ISNAN,
"__builtin_isnan", true); "__builtin_isnan", true);
...@@ -984,109 +965,70 @@ gfc_init_builtin_functions (void) ...@@ -984,109 +965,70 @@ gfc_init_builtin_functions (void)
builtin_types[(int) ENUM] = VALUE; builtin_types[(int) ENUM] = VALUE;
#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \ #define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type (builtin_types[(int) RETURN], \ = build_function_type_list (builtin_types[(int) RETURN], \
void_list_node); NULL_TREE);
#define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \ #define DEF_FUNCTION_TYPE_1(ENUM, RETURN, ARG1) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type (builtin_types[(int) RETURN], \ = build_function_type_list (builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
void_list_node)); NULL_TREE);
#define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \ #define DEF_FUNCTION_TYPE_2(ENUM, RETURN, ARG1, ARG2) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
void_list_node))); NULL_TREE);
#define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \ #define DEF_FUNCTION_TYPE_3(ENUM, RETURN, ARG1, ARG2, ARG3) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG3], \ builtin_types[(int) ARG3], \
void_list_node)))); NULL_TREE);
#define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \ #define DEF_FUNCTION_TYPE_4(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG3], \ builtin_types[(int) ARG3], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG4], \ builtin_types[(int) ARG4], \
void_list_node))))); NULL_TREE);
#define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \ #define DEF_FUNCTION_TYPE_5(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG3], \ builtin_types[(int) ARG3], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG4], \ builtin_types[(int) ARG4], \
tree_cons (NULL_TREE, \ builtin_types[(int) ARG5], \
builtin_types[(int) ARG5],\ NULL_TREE);
void_list_node))))));
#define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ #define DEF_FUNCTION_TYPE_6(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
ARG6) \ ARG6) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG3], \ builtin_types[(int) ARG3], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG4], \ builtin_types[(int) ARG4], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG5], \ builtin_types[(int) ARG5], \
tree_cons (NULL_TREE, \ builtin_types[(int) ARG6], \
builtin_types[(int) ARG6],\ NULL_TREE);
void_list_node)))))));
#define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \ #define DEF_FUNCTION_TYPE_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, \
ARG6, ARG7) \ ARG6, ARG7) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type \ = build_function_type_list (builtin_types[(int) RETURN], \
(builtin_types[(int) RETURN], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG1], \ builtin_types[(int) ARG1], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG2], \ builtin_types[(int) ARG2], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG3], \ builtin_types[(int) ARG3], \
tree_cons \
(NULL_TREE, \
builtin_types[(int) ARG4], \ builtin_types[(int) ARG4], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG5], \ builtin_types[(int) ARG5], \
tree_cons (NULL_TREE, \
builtin_types[(int) ARG6],\
tree_cons (NULL_TREE, \
builtin_types[(int) ARG6], \ builtin_types[(int) ARG6], \
void_list_node)))))))); builtin_types[(int) ARG7], \
NULL_TREE);
#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \ #define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_function_type (builtin_types[(int) RETURN], NULL_TREE); = build_varargs_function_type_list (builtin_types[(int) RETURN], \
NULL_TREE);
#define DEF_POINTER_TYPE(ENUM, TYPE) \ #define DEF_POINTER_TYPE(ENUM, TYPE) \
builtin_types[(int) ENUM] \ builtin_types[(int) ENUM] \
= build_pointer_type (builtin_types[(int) TYPE]); = build_pointer_type (builtin_types[(int) TYPE]);
......
...@@ -4633,8 +4633,7 @@ gfc_generate_constructors (void) ...@@ -4633,8 +4633,7 @@ gfc_generate_constructors (void)
return; return;
fnname = get_file_function_name ("I"); fnname = get_file_function_name ("I");
type = build_function_type (void_type_node, type = build_function_type_list (void_type_node, NULL_TREE);
gfc_chainon_list (NULL_TREE, void_type_node));
fndecl = build_decl (input_location, fndecl = build_decl (input_location,
FUNCTION_DECL, fnname, type); FUNCTION_DECL, fnname, type);
......
...@@ -870,7 +870,7 @@ gfc_init_types (void) ...@@ -870,7 +870,7 @@ gfc_init_types (void)
ppvoid_type_node = build_pointer_type (pvoid_type_node); ppvoid_type_node = build_pointer_type (pvoid_type_node);
pchar_type_node = build_pointer_type (gfc_character1_type_node); pchar_type_node = build_pointer_type (gfc_character1_type_node);
pfunc_type_node pfunc_type_node
= build_pointer_type (build_function_type (void_type_node, NULL_TREE)); = build_pointer_type (build_function_type_list (void_type_node, NULL_TREE));
gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind); gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind);
/* We cannot use gfc_index_zero_node in definition of gfc_array_range_type, /* We cannot use gfc_index_zero_node in definition of gfc_array_range_type,
...@@ -1934,7 +1934,7 @@ gfc_get_ppc_type (gfc_component* c) ...@@ -1934,7 +1934,7 @@ gfc_get_ppc_type (gfc_component* c)
else else
t = void_type_node; t = void_type_node;
return build_pointer_type (build_function_type (t, NULL_TREE)); return build_pointer_type (build_function_type_list (t, NULL_TREE));
} }
......
...@@ -7330,7 +7330,7 @@ build_function_type_list_1 (bool vaargs, tree return_type, va_list argp) ...@@ -7330,7 +7330,7 @@ build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
last = args; last = args;
if (args != NULL_TREE) if (args != NULL_TREE)
args = nreverse (args); args = nreverse (args);
gcc_assert (args != NULL_TREE && last != void_list_node); gcc_assert (last != void_list_node);
} }
else if (args == NULL_TREE) else if (args == NULL_TREE)
args = void_list_node; args = void_list_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment