if (!res && size != 0)
_gfortran_os_error ("Out of memory");
- if (size == 0)
- return NULL;
-
return res;
} */
tree
gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
{
- tree msg, res, negative, nonzero, zero, null_result, tmp;
+ tree msg, res, negative, nonzero, null_result, tmp;
tree type = TREE_TYPE (mem);
size = gfc_evaluate_now (size, block);
build_empty_stmt (input_location));
gfc_add_expr_to_block (block, tmp);
- /* if (size == 0) then the result is NULL. */
- tmp = fold_build2 (MODIFY_EXPR, type, res, build_int_cst (type, 0));
- zero = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, nonzero);
- tmp = fold_build3 (COND_EXPR, void_type_node, zero, tmp,
- build_empty_stmt (input_location));
- gfc_add_expr_to_block (block, tmp);
-
return res;
}