From 2bb1fc26a11e2ca13ef8e6a42ea31f63182b0562 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 7 Aug 2010 21:12:32 +0000 Subject: decl.c (gnat_to_gnu_entity): Use XALLOCAVEC instead of alloca. * gcc-interface/decl.c (gnat_to_gnu_entity): Use XALLOCAVEC instead of alloca. (components_to_record): Likewise. * gcc-interface/trans.c (gnat_to_gnu): Likewise. * gcc-interface/utils.c (max_size): Likewise. (build_vms_descriptor32): Likewise. (build_vms_descriptor): Likewise. From-SVN: r162985 --- gcc/ada/gcc-interface/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/ada/gcc-interface/utils.c') diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index eed426a..381d71b 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -2134,7 +2134,7 @@ max_size (tree exp, bool max_p) n = call_expr_nargs (exp); gcc_assert (n > 0); - argarray = (tree *) alloca (n * sizeof (tree)); + argarray = XALLOCAVEC (tree, n); 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); @@ -2317,7 +2317,7 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ndim++, inner_type = TREE_TYPE (inner_type)) ; - idx_arr = (tree *) alloca (ndim * sizeof (tree)); + idx_arr = XALLOCAVEC (tree, ndim); if (mech != By_Descriptor_NCA && mech != By_Short_Descriptor_NCA && TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type)) @@ -2631,7 +2631,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ndim++, inner_type = TREE_TYPE (inner_type)) ; - idx_arr = (tree *) alloca (ndim * sizeof (tree)); + idx_arr = XALLOCAVEC (tree, ndim); if (mech != By_Descriptor_NCA && TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type)) -- cgit v1.1