From 8f992d640ed577dd5a8427d8c7855d7a51287e7f Mon Sep 17 00:00:00 2001 From: Daniel Carrera Date: Thu, 21 Jul 2011 23:18:24 +0000 Subject: trans.c (gfc_allocate_with_status): Split into two functions gfc_allocate_using_malloc and gfc_allocate_usig_lib. 2011-07-21 Daniel Carrera * trans.c (gfc_allocate_with_status): Split into two functions gfc_allocate_using_malloc and gfc_allocate_usig_lib. (gfc_allocate_using_malloc): The status parameter is now the actual status rather than a pointer. Code cleanup. (gfc_allocate_using_lib): Ditto. Add new parametrs errmsg and errlen. Pass these to the coarray lib. * trans-openmp.c (gfc_omp_clause_default_ctor): Update calls to gfc_allocate_allocatable. (gfc_omp_clause_copy_ctor): Ditto. (gfc_trans_omp_array_reduction): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. Update call to gfc_allocate_using_malloc. Pass stat rather than pstat to the allocate fuctions. If using coarray lib, pass errmsg and errlen to the allocate functions. Move error checking outside the if (!gfc_array_allocate) block so that it also affects trees produced by gfc_array_allocate. * trans-array.c (gfc_array_allocate): Add new parameters errmsg and errlen. Replace parameter pstat by status. Code cleanup. Update calls to gfc_allocate_allocatable and gfc_allocate_using_malloc. * trans-array.h (gfc_array_allocate): Update signature of gfc_array_allocate. From-SVN: r176606 --- gcc/fortran/trans-openmp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gcc/fortran/trans-openmp.c') diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index aff8554..cd5ef0a 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -188,9 +188,9 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer) size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type, size, esize); size = gfc_evaluate_now (fold_convert (size_type_node, size), &cond_block); - ptr = gfc_allocate_allocatable_with_status (&cond_block, - build_int_cst (pvoid_type_node, 0), - size, NULL, NULL); + ptr = gfc_allocate_allocatable (&cond_block, + build_int_cst (pvoid_type_node, 0), + size, NULL_TREE, NULL_TREE, NULL_TREE, NULL); gfc_conv_descriptor_data_set (&cond_block, decl, ptr); then_b = gfc_finish_block (&cond_block); @@ -241,9 +241,9 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src) size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type, size, esize); size = gfc_evaluate_now (fold_convert (size_type_node, size), &block); - ptr = gfc_allocate_allocatable_with_status (&block, - build_int_cst (pvoid_type_node, 0), - size, NULL, NULL); + ptr = gfc_allocate_allocatable (&block, + build_int_cst (pvoid_type_node, 0), + size, NULL_TREE, NULL_TREE, NULL_TREE, NULL); gfc_conv_descriptor_data_set (&block, dest, ptr); call = build_call_expr_loc (input_location, built_in_decls[BUILT_IN_MEMCPY], 3, ptr, @@ -663,9 +663,9 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where) size = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type, size, esize); size = gfc_evaluate_now (fold_convert (size_type_node, size), &block); - ptr = gfc_allocate_allocatable_with_status (&block, - build_int_cst (pvoid_type_node, 0), - size, NULL, NULL); + ptr = gfc_allocate_allocatable (&block, + build_int_cst (pvoid_type_node, 0), + size, NULL_TREE, NULL_TREE, NULL_TREE, NULL); gfc_conv_descriptor_data_set (&block, decl, ptr); gfc_add_expr_to_block (&block, gfc_trans_assignment (e1, e2, false, false)); -- cgit v1.1