On Thu, Aug 12, 2021 at 10:10:10AM +0800, Kewen.Lin wrote: > > + enum rs6000_builtins vname = RS6000_BUILTIN_COUNT; > > > > Using this as a flag value looks unnecessary. Is this just being done to > > silence a warning? > > Good question! I didn't notice there is a warning or not, just get used to > initializing variable > with one suitable value if possible. If you don't mind, may I still keep it? > Since if some > future codes use vname in a path where it's not assigned, one explicitly > wrong enum (bif) seems > better than a random one. Or will this mentioned possibility definitely > never happen since the > current uninitialized variables detection and warning scheme is robust and > should not worry about > that completely?
It is a bad idea to initialise things unnecessary: it hinders many optimisations, but much more importantly, it silences warnings without fixing the problem. > > + if (vname != RS6000_BUILTIN_COUNT > > > > Check is not necessary, as you will have returned by now in that case. > > Thanks for catching, I put break for "default" initially, didn't noticed the > following condition > need an adjustment after updating it to early return. Will fix it. Thanks :-) Segher