Add malloc predictor (PR middle-end/83023).
authorMartin Liska <mliska@suse.cz>
Tue, 7 Aug 2018 11:59:13 +0000 (13:59 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 7 Aug 2018 11:59:13 +0000 (11:59 +0000)
commit806562fd6269a3d7e0651d5bbf9085c7708fb5cd
treeeaa3b52796a56d33f60e9066a720a28f86390a1f
parentea2329d170827cf9d321324844035a4a2dcfec96
Add malloc predictor (PR middle-end/83023).

2018-08-07  Martin Liska  <mliska@suse.cz>

        PR middle-end/83023
* predict.c (expr_expected_value_1): Handle DECL_IS_MALLOC,
        BUILT_IN_REALLOC and DECL_IS_OPERATOR_NEW.
* predict.def (PRED_MALLOC_NONNULL): New predictor.
* doc/extend.texi: Document that malloc attribute adds
        hit to compiler.
2018-08-07  Martin Liska  <mliska@suse.cz>

        PR middle-end/83023
* gcc.dg/predict-16.c: New test.
* g++.dg/predict-1.C: New test.

From-SVN: r263355
gcc/ChangeLog
gcc/doc/extend.texi
gcc/predict.c
gcc/predict.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/predict-1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/predict-16.c [new file with mode: 0644]