Hi, the attached patch replaces gfc_getmem with calls to xcalloc (from libiberty). Apart from reducing duplicated code, calloc is better than malloc + memset, as the allocator knows that the kernel always gives out zeroed pages so in some cases it can avoid memset'in the area. Regtested on x86_64-unknown-linux-gnu, Ok for trunk? 2011-04-18 Janne Blomqvist * misc.c (gfc_getmem): Remove function. * gfortran.h: Remove gfc_getmem prototype. Replace gfc_getmem usage with xcalloc. * expr.c (gfc_check_assign_symbol): Replace gfc_getmem usage with xcalloc. * options.c (gfc_handle_module_path_options) (gfc_get_option_string): Likewise. * resolve.c (gfc_resolve_forall): Likewise. * scanner.c (load_file): Likewise. * simplify.c (simplify_transformation_to_array): Likewise. * target-memory.c (gfc_target_interpret_expr): Likewise. * trans-common.c (get_segment_info, copy_equiv_list_to_ns) (get_init_field): Likewise. * trans-expr.c (gfc_conv_statement_function): Likewise. * trans-io.c (nml_full_name): Likewise. * trans-stmt.c (gfc_trans_forall_1): Likewise. -- Janne Blomqvist