aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c24
1 files changed, 13 insertions, 11 deletions
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);
}