diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-01-17 15:34:37 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-01-17 15:34:37 +0100 |
commit | 4df0f7da3775139a40ef3b4a6fbcdb1413097b26 (patch) | |
tree | 75c350173bf02c20c7b58624799e25a6251db29c /gcc/fortran/f95-lang.c | |
parent | 1efa38d1a7eda7384e59feae004b653b6c192710 (diff) | |
download | gcc-4df0f7da3775139a40ef3b4a6fbcdb1413097b26.zip gcc-4df0f7da3775139a40ef3b4a6fbcdb1413097b26.tar.gz gcc-4df0f7da3775139a40ef3b4a6fbcdb1413097b26.tar.bz2 |
re PR fortran/51869 (Realloc on assignment wrongly assumes that MALLOC returnes '\0'-set memory)
2012-01-17 Tobias Burnus <burnus@net-b.de>
Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/51869
* trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
LHS after allocation, if it has allocatable components.
* f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
2012-01-17 Tobias Burnus <burnus@net-b.de>
PR fortran/51869
* gfortran.dg/realloc_on_assign_9.f90: New.
Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>
From-SVN: r183247
Diffstat (limited to 'gcc/fortran/f95-lang.c')
-rw-r--r-- | gcc/fortran/f95-lang.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 57c0114..a68d2fc 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -1007,6 +1007,12 @@ gfc_init_builtin_functions (void) "malloc", ATTR_NOTHROW_LEAF_LIST); DECL_IS_MALLOC (builtin_decl_explicit (BUILT_IN_MALLOC)) = 1; + ftype = build_function_type_list (pvoid_type_node, size_type_node, + size_type_node, NULL_TREE); + gfc_define_builtin ("__builtin_calloc", ftype, BUILT_IN_CALLOC, + "calloc", ATTR_NOTHROW_LEAF_LIST); + DECL_IS_MALLOC (builtin_decl_explicit (BUILT_IN_CALLOC)) = 1; + ftype = build_function_type_list (pvoid_type_node, size_type_node, pvoid_type_node, NULL_TREE); |