Commit 9ef0b98e by Richard Guenther Committed by Richard Biener

trans.c (gfc_allocate_array_with_status): Mark error path as unlikely.

2011-06-09  Richard Guenther  <rguenther@suse.de>

	* trans.c (gfc_allocate_array_with_status): Mark error path
	as unlikely.

From-SVN: r174842
parent dd27d2fa
2011-06-09 Richard Guenther <rguenther@suse.de>
* trans.c (gfc_allocate_array_with_status): Mark error path
as unlikely.
2011-06-08 Tobias Burnus <burnus@net-b.de> 2011-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/18918 PR fortran/18918
......
...@@ -697,8 +697,9 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size, ...@@ -697,8 +697,9 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size,
/* Create a variable to hold the result. */ /* Create a variable to hold the result. */
res = gfc_create_var (type, NULL); res = gfc_create_var (type, NULL);
null_mem = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, mem, null_mem = gfc_unlikely (fold_build2_loc (input_location, NE_EXPR,
build_int_cst (type, 0)); boolean_type_node, mem,
build_int_cst (type, 0)));
/* If mem is NULL, we call gfc_allocate_with_status. */ /* If mem is NULL, we call gfc_allocate_with_status. */
gfc_start_block (&alloc_block); gfc_start_block (&alloc_block);
...@@ -751,7 +752,7 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size, ...@@ -751,7 +752,7 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size,
} }
tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, null_mem, tmp = fold_build3_loc (input_location, COND_EXPR, void_type_node, null_mem,
alloc, error); error, alloc);
gfc_add_expr_to_block (block, tmp); gfc_add_expr_to_block (block, tmp);
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment