diff options
author | Martin Liska <mliska@suse.cz> | 2016-06-16 14:21:55 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-06-16 12:21:55 +0000 |
commit | 7f7fa20fdd7f13844868541c57063327bf3bec51 (patch) | |
tree | b131ad95625b4a3221ddf076bbe3d9629b80aa69 /gcc/predict.def | |
parent | 73170f9e46783e03f96133d9ee96e96f8cd4fd38 (diff) | |
download | gcc-7f7fa20fdd7f13844868541c57063327bf3bec51.zip gcc-7f7fa20fdd7f13844868541c57063327bf3bec51.tar.gz gcc-7f7fa20fdd7f13844868541c57063327bf3bec51.tar.bz2 |
Fix code emission for FAIL_ALLOC predictor
* predict.def: Define a new predictor.
* trans-array.c (gfc_array_allocate): Do not generate expect
stmt.
* trans.c (gfc_allocate_using_malloc): Properly set FAIL_ALLOC
predictor for malloc return value.
(gfc_allocate_allocatable): Use REALLOC predictor instead of
FAIL_ALLOC.
(gfc_deallocate_with_status): Likewise.
From-SVN: r237524
Diffstat (limited to 'gcc/predict.def')
-rw-r--r-- | gcc/predict.def | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/predict.def b/gcc/predict.def index c0a3f36..da4f9ab 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -163,12 +163,15 @@ DEF_PREDICTOR (PRED_FORTRAN_OVERFLOW, "overflow", PROB_ALWAYS, PRED_FLAG_FIRST_MATCH) /* Branch leading to a failure status are unlikely. This can occur for out - of memory or when trying to allocate an already allocated allocated or - deallocating an already deallocated allocatable. This predictor only - occurs when the user explicitly asked for a return status. By default, - the code aborts, which is handled via PRED_NORETURN. - FIXME: the hitrate really ought to be close to 100%. */ -DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", HITRATE (62), 0) + of memory. This predictor only occurs when the user explicitly asked + for a return status. By default, the code aborts, + which is handled via PRED_NORETURN. */ +DEF_PREDICTOR (PRED_FORTRAN_FAIL_ALLOC, "fail alloc", PROB_VERY_LIKELY, 0) + +/* Predictor is used for an allocation of an already allocated memory or + deallocating an already deallocated allocatable. */ +DEF_PREDICTOR (PRED_FORTRAN_REALLOC, "repeated allocation/deallocation", \ + PROB_LIKELY, 0) /* Branch leading to an I/O failure status are unlikely. This predictor is used for I/O failures such as for invalid unit numbers. This predictor |