diff options
author | Richard Guenther <rguenther@suse.de> | 2011-06-09 12:17:17 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-06-09 12:17:17 +0000 |
commit | 9ef0b98eb62b22e291e4cca4537d64ea2b795c14 (patch) | |
tree | 9a66317140d8580efd8ced6fabbb4349946773d5 /gcc | |
parent | dd27d2fadd466c13f64ca412cf35e3691285d75e (diff) | |
download | gcc-9ef0b98eb62b22e291e4cca4537d64ea2b795c14.zip gcc-9ef0b98eb62b22e291e4cca4537d64ea2b795c14.tar.gz gcc-9ef0b98eb62b22e291e4cca4537d64ea2b795c14.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/trans.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c77c6ed..dad51bf 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +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> PR fortran/18918 diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index f2f1352..ee35387 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -697,8 +697,9 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size, /* Create a variable to hold the result. */ res = gfc_create_var (type, NULL); - null_mem = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node, mem, - build_int_cst (type, 0)); + null_mem = gfc_unlikely (fold_build2_loc (input_location, NE_EXPR, + boolean_type_node, mem, + build_int_cst (type, 0))); /* If mem is NULL, we call gfc_allocate_with_status. */ gfc_start_block (&alloc_block); @@ -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, - alloc, error); + error, alloc); gfc_add_expr_to_block (block, tmp); return res; |