Message ID | b9e2fb20-7869-da76-2c01-f1bb1e7b477a@redhat.com |
---|---|
State | New |
Headers | show |
Series | Re: error: ‘EVRP_MODE_DEBUG’ was not declared – was: [PUSHED] Ranger classes. | expand |
On Mon, 26 Oct 2020, Andrew MacLeod wrote: > > It is still broken at `-O0', does not build with `--enable-werror-always' > > (which IMO should be on by default except for releases, just as we do with > > binutils AFAIK, so as to make sure people do not introduce build problems > > too easily): > > > > .../gcc/gimple-range.cc: In function 'bool > > range_of_builtin_call(range_query&, irange&, gcall*)': > > .../gcc/gimple-range.cc:677:15: error: 'zerov' may be used uninitialized > > [-Werror=maybe-uninitialized] > > 677 | if (zerov == prec) > > | ^~ > > cc1plus: all warnings being treated as errors > > make[2]: *** [Makefile:1122: gimple-range.o] Error 1 > > > > Maciej > > > I can't reproduce it on x86_64-pc-linux-gnu , i presume this is some other > target. > > Eyeballing it, it seems that there was a missed initialization when the > builtin code was ported that might show up on a target that defines > CLZ_DEFINED_VALUE_AT_ZERO to be non-zero but doesnt always set the zerov > parameter... Or maybe it some optimization ordering thing. Let me see... $ g++ [...] .../gcc/gimple-range.cc -E -dD | grep CLZ_DEFINED_VALUE_AT_ZERO #define CLZ_DEFINED_VALUE_AT_ZERO(MODE,VALUE) 0 $ I'm fairly sure this is what the default is. > Anyway, the following patch has been pushed as an obvious fix to make the code > match whats in vr-values. Thank you! Maciej
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 267ebad757f..f5c6a1ca620 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -611,7 +611,7 @@ range_of_builtin_call (range_query &query, irange &r, gcall *call) tree type = gimple_call_return_type (call); tree arg; - int mini, maxi, zerov, prec; + int mini, maxi, zerov = 0, prec; scalar_int_mode mode; switch (func)