This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix unnecessary -Wnarrowing warning in predict.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 Mar 2018 16:11:10 +0100
- Subject: [committed] Fix unnecessary -Wnarrowing warning in predict.c
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
branch_predictor::probability has int type, so using -1U produces
-Wnarrowing warning.
Fixed thusly, committed as obvious to trunk.
2018-03-02 Jakub Jelinek <jakub@redhat.com>
* predict.c (test_prediction_value_range): Use PROB_UNINITIALIZED
instead of -1U in last predictors element's probability member.
--- gcc/predict.c.jj 2018-01-26 12:43:25.139922494 +0100
+++ gcc/predict.c 2018-03-02 15:24:21.735715210 +0100
@@ -4204,7 +4204,7 @@ test_prediction_value_range ()
{
branch_predictor predictors[] = {
#include "predict.def"
- {NULL, -1U}
+ { NULL, PROB_UNINITIALIZED }
};
for (unsigned i = 0; predictors[i].name != NULL; i++)
Jakub