This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix unnecessary -Wnarrowing warning in predict.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]