https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82101
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Richard Biener from comment #1) > Dup of some existing bug for sure. t looks like initialized to GCC on the > backedge: Not any that I know. > but that gets later optimistically propagated away (the variable is dead > anyway) > and thus the late pass warning about maybe-uninitialized doesn't get here. Does the late pass ever warn for self-initialization? void foo(int); int main(){ for(int i = 0 ; i < 10 ; i ++){ int t=t; foo(t); } return 0; } > Now what is special here is that the uninit value is on the loop entry edge > so the early pass _could_ warn. This seems the bug indeed. void foo(void); int main(){ for(int i = 0 ; i < 10 ; i ++){ int t=t; foo(); } return 0; } > It also looks like we could improve on scoping here when re-writing into SSA. > t doesn't need a PHI node as the value is not live over the backedge. missed-opt then?