on 2021/8/25 上午5:56, Segher Boessenkool wrote: > On Fri, Aug 13, 2021 at 11:18:46AM +0800, Kewen.Lin wrote: >> on 2021/8/12 下午11:51, Segher Boessenkool wrote: >>> It is a bad idea to initialise things unnecessary: it hinders many >>> optimisations, but much more importantly, it silences warnings without >>> fixing the problem. >> >> OK, I've made it uninitialized in v2. :-) I believe the context here is >> simple >> and the uninit-ed var detector can easily catch and warn the bad thing in >> future. > > And those warnings generally are for "MAY BE used uninitialised", > anyway. They will warn :-) > > (When the warning says "IS used uninitialised" the compiler should be > sure about that!) > >> Sorry for chasing dead ends, I don't follow how it can hinder optimizations >> here, >> IIUC it would be optimized as a dead store here? > > When the compiler is not sure if something needs initialisation or not > it cannot remove actually superfluous initialisation. Such cases are > always too complicated code, so that should be fixed, not silenced :-) >
aha, you meant complicated code, got it. :) >> As to the warning, although >> there is no warning, I'd expect it causes ICE since the init-ed bif name >> isn't >> reasonable for generation. Wouldn't it be better than warning? Sometimes we >> don't have a proper value for initialization, I agree it should be better to >> just leave it be, but IMHO it isn't the case here. :) > > ICEing is always wrong. A user should never see an ICE (not counting > "sorry"s as ICEs here -- not that those are good, but they tell the user > exactly what is going on). > Yeah, but here I was expecting the ICE happens when GCC developers are testing the newly added bif supports. :) BR, Kewen