From 9f3432b8a677aa18c1e12cdd9604f533b0745e2c Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 16 Feb 2007 23:40:52 +0000 Subject: trans.c (call_to_gnu): Use build_call_list instead of build3 to build the call expression. * trans.c (call_to_gnu): Use build_call_list instead of build3 to build the call expression. (gnat_stabilize_reference_1): Handle tcc_vl_exp. * utils.c (max_size) : Delete. : New case. : Delete CALL_EXPR subcase. (build_global_cdtor): Use build_call_nary instead of build3. * utils2.c (build_call_1_expr): Likewise. (build_call_2_expr): Likewise. (build_call_0_expr): Likewise. (build_call_alloc_dealloc): Likewise. Co-Authored-By: Sandra Loosemore From-SVN: r122058 --- gcc/ada/utils.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'gcc/ada/utils.c') diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 52bc663..6dc47de 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -2335,12 +2335,18 @@ max_size (tree exp, bool max_p) case tcc_constant: return exp; - case tcc_exceptional: - if (code == TREE_LIST) - return tree_cons (TREE_PURPOSE (exp), - max_size (TREE_VALUE (exp), max_p), - TREE_CHAIN (exp) - ? max_size (TREE_CHAIN (exp), max_p) : NULL_TREE); + case tcc_vl_exp: + if (code == CALL_EXPR) + { + tree *argarray; + int i, n = call_expr_nargs (exp); + gcc_assert (n > 0); + + argarray = (tree *) alloca (n * sizeof (tree)); + for (i = 0; i < n; i++) + argarray[i] = max_size (CALL_EXPR_ARG (exp, i), max_p); + return build_call_array (type, CALL_EXPR_FN (exp), n, argarray); + } break; case tcc_reference: @@ -2428,9 +2434,6 @@ max_size (tree exp, bool max_p) return fold (build2 (max_p ? MAX_EXPR : MIN_EXPR, type, max_size (TREE_OPERAND (exp, 1), max_p), max_size (TREE_OPERAND (exp, 2), max_p))); - else if (code == CALL_EXPR && TREE_OPERAND (exp, 1)) - return build3 (CALL_EXPR, type, TREE_OPERAND (exp, 0), - max_size (TREE_OPERAND (exp, 1), max_p), NULL); } /* Other tree classes cannot happen. */ @@ -3745,8 +3748,7 @@ build_global_cdtor (int method_type, tree *vec, int len) { tree fntype = TREE_TYPE (vec[i]); tree fnaddr = build1 (ADDR_EXPR, build_pointer_type (fntype), vec[i]); - tree fncall = build3 (CALL_EXPR, TREE_TYPE (fntype), fnaddr, NULL_TREE, - NULL_TREE); + tree fncall = build_call_nary (TREE_TYPE (fntype), fnaddr, 0); append_to_statement_list (fncall, &body); } -- cgit v1.1