[tree-ssa] Unused variable warnings
Jan Hubicka
hubicka@ucw.cz
Sun Oct 19 14:05:00 GMT 2003
> In message <20031017193025.GO6212@kam.mff.cuni.cz>, Jan Hubicka writes:
> >OK,
> >I have one problem. It is a warning:
> >../../gcc/haifa-sched.c:2042: warning: 'index' might be used uninitialized in
> > this function
> >
> >index is initialized by:
> >if (max_issue (ready, &index) == 0)
> >
> >where max_issue is function that really has path throught that really
> >does not write into the index variable, so this warning is de-facto
> >right, just not obvious. What do we want to do here?
> If there's really a path were index is uninitialized, then clearly we
> want to initialize it to a safe value, both for the branch and the
> mainline.
Yes, however the path is created by inlining function max_issue and
optimizing out & and *. So whether we realize this condition or not
depend on how much inlining we do that is somewhat ugly.
The path never actually happens in reality (max_issue either finds value
and sets it or indicate failure), but we are not smart enought to thread
the jumps.
>
> >Shall I simply add initializer to this variable and another one in
> >f/lex.c as we do in usual case of this warning?
> If f/lex.c also has a real path where the variable is uninitialized, yes
> (and again, the same patch probably belongs on the mainline).
Similarly here.
Honza
>
> jeff
More information about the Gcc
mailing list