From 54200abb68aed1ddf147251fcbe402549482d499 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 13 Dec 2006 09:57:56 +0000 Subject: re PR fortran/30115 (allocate() interface pessimizes aliasing) 2006-12-13 Richard Guenther PR fortran/30115 * runtime/memory.c (allocate_size): Change interface to void *()(size_t, GFC_INTEGER_4 *). (allocate): Likewise. (allocate64): Likewise. (allocate_array): Change interface to void *()(void *, size_t, GFC_INTEGER_4 *). (allocate64_array): Likewise. (deallocate): Change interface to void ()(void *, GFC_INTEGER_4 *). * trans-array.c (gfc_array_allocate): Adjust for changed library interface. (gfc_array_deallocate): Likewise. (gfc_trans_dealloc_allocated): Likewise. * trans-stmt.c (gfc_trans_allocate): Likewise. (gfc_trans_deallocate): Likewise. * trans-decl.c (gfc_build_builtin_function_decls): Adjust function declarations to match the library changes. Mark allocation functions with DECL_IS_MALLOC. From-SVN: r119822 --- gcc/fortran/trans-decl.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'gcc/fortran/trans-decl.c') diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 67e654c..815b15e 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -2304,27 +2304,31 @@ gfc_build_builtin_function_decls (void) gfor_fndecl_allocate = gfc_build_library_function_decl (get_identifier (PREFIX("allocate")), - void_type_node, 2, ppvoid_type_node, - gfc_int4_type_node); + pvoid_type_node, 2, + gfc_int4_type_node, gfc_pint4_type_node); + DECL_IS_MALLOC (gfor_fndecl_allocate) = 1; gfor_fndecl_allocate64 = gfc_build_library_function_decl (get_identifier (PREFIX("allocate64")), - void_type_node, 2, ppvoid_type_node, - gfc_int8_type_node); + pvoid_type_node, 2, + gfc_int8_type_node, gfc_pint4_type_node); + DECL_IS_MALLOC (gfor_fndecl_allocate64) = 1; gfor_fndecl_allocate_array = gfc_build_library_function_decl (get_identifier (PREFIX("allocate_array")), - void_type_node, 2, ppvoid_type_node, - gfc_int4_type_node); + pvoid_type_node, 3, pvoid_type_node, + gfc_int4_type_node, gfc_pint4_type_node); + DECL_IS_MALLOC (gfor_fndecl_allocate_array) = 1; gfor_fndecl_allocate64_array = gfc_build_library_function_decl (get_identifier (PREFIX("allocate64_array")), - void_type_node, 2, ppvoid_type_node, - gfc_int8_type_node); + pvoid_type_node, 3, pvoid_type_node, + gfc_int8_type_node, gfc_pint4_type_node); + DECL_IS_MALLOC (gfor_fndecl_allocate64_array) = 1; gfor_fndecl_deallocate = gfc_build_library_function_decl (get_identifier (PREFIX("deallocate")), - void_type_node, 2, ppvoid_type_node, + void_type_node, 2, pvoid_type_node, gfc_pint4_type_node); gfor_fndecl_stop_numeric = -- cgit v1.1