This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
program test integer, allocatable :: A(:), B[:] integer :: stat character(len=33) :: str allocate(A(1), B[*], stat=stat) end program
* trans.c (gfc__allocate_allocatable): [PR 4755] Do not fix and the reallocate a variable that is already allocated. -- I'm not overweight, I'm undertall.
diff -r c8b6eb02738a gcc/fortran/trans.c --- a/gcc/fortran/trans.c Fri Jul 22 09:21:49 2011 +0000 +++ b/gcc/fortran/trans.c Fri Jul 22 20:36:23 2011 +0200 @@ -775,13 +775,8 @@ gfc_allocate_allocatable (stmtblock_t * stmtblock_t set_status_block; gfc_start_block (&set_status_block); - tmp = build_call_expr_loc (input_location, - built_in_decls[BUILT_IN_FREE], 1, - fold_convert (pvoid_type_node, mem)); - gfc_add_expr_to_block (&set_status_block, tmp); - tmp = gfc_allocate_using_malloc (&set_status_block, size, status); - gfc_add_modify (&set_status_block, res, fold_convert (type, tmp)); + gfc_add_modify (&set_status_block, res, fold_convert (type, mem)); gfc_add_modify (&set_status_block, status, build_int_cst (status_type, LIBERROR_ALLOCATION));
Attachment:
tree-after.original
Description: Text document
Attachment:
tree-before.original
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |