From: jakub Date: Tue, 27 Jun 2017 09:13:53 +0000 (+0000) Subject: * predict.c (test_prediction_value_range): Use -1U instead of -1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=954a2d23af28ec77b97d9e4bbdb0de1beeb57ec6;p=thirdparty%2Fgcc.git * predict.c (test_prediction_value_range): Use -1U instead of -1 to avoid narrowing conversion warning. * dumpfile.c (dump_options): Wrap all value into dump_flags_t cast to avoid narrowing conversion warning. * opt-functions.awk (var_ref): Return (unsigned short) -1 instead of -1. * optc-gen.awk (END): Expect (unsigned short) -1 instead of -1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249683 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f2754154a22..36773196eec6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-06-27 Jakub Jelinek + + * predict.c (test_prediction_value_range): Use -1U instead of -1 + to avoid narrowing conversion warning. + * dumpfile.c (dump_options): Wrap all value into dump_flags_t cast + to avoid narrowing conversion warning. + * opt-functions.awk (var_ref): Return (unsigned short) -1 instead of + -1. + * optc-gen.awk (END): Expect (unsigned short) -1 instead of -1. + 2017-06-27 Jerome Lambourg * config/vxworks.h (VXWORKS_LIBS_RTP): Alternative definition for diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 6c55f05b6773..c3dd12684006 100644 --- a/gcc/dumpfile.c +++ b/gcc/dumpfile.c @@ -110,9 +110,9 @@ static const struct dump_option_value_info dump_options[] = {"missed", MSG_MISSED_OPTIMIZATION}, {"note", MSG_NOTE}, {"optall", MSG_ALL}, - {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH | TDF_STMTADDR - | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV - | TDF_GIMPLE)}, + {"all", dump_flags_t (~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH + | TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID + | TDF_ENUMERATE_LOCALS | TDF_SCEV | TDF_GIMPLE))}, {NULL, 0} }; diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk index 0736a6f3fafe..b367d3a5b194 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -275,7 +275,7 @@ function var_ref(name, flags) return "offsetof (struct gcc_options, x_target_flags)" if (opt_args("InverseMask", flags) != "") return "offsetof (struct gcc_options, x_target_flags)" - return "-1" + return "(unsigned short) -1" } # Given the option called NAME return a sanitized version of its name. diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 3b9126ccf97d..eaaec25f74f0 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -336,7 +336,7 @@ for (i = 0; i < n_opts; i++) { alias_posarg = nth_arg(1, alias_arg) alias_negarg = nth_arg(2, alias_arg) - if (var_ref(opts[i], flags[i]) != "-1") + if (var_ref(opts[i], flags[i]) != "(unsigned short) -1") print "#error Alias setting variable" if (alias_posarg != "" && alias_negarg == "") { diff --git a/gcc/predict.c b/gcc/predict.c index 44151bc2e6ce..71d6d0a5bb1f 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -4031,7 +4031,7 @@ test_prediction_value_range () { branch_predictor predictors[] = { #include "predict.def" - {NULL, -1} + {NULL, -1U} }; for (unsigned i = 0; predictors[i].name != NULL; i++)