https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39612
Aldy Hernandez <aldyh at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at gcc dot gnu.org --- Comment #29 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- (In reply to Richard Biener from comment #11) > Re-confirmed on trunk with the testcase in comment #4 and -Os: > > > ./cc1 -quiet t.c -Os -Wall -fdump-tree-all > t.c: In function 'f2': > t.c:4:11: warning: 'inter[0]' is used uninitialized in this function > [-Wuninitialized] > t.c:4:11: warning: 'inter[1]' is used uninitialized in this function > [-Wuninitialized] > > There is also a store data-race introduced by LIM when the loop header > is not copied. I suppose the real fix is to disable SM if the loop > header is not copied. The warning is gone for the testcase in comment #4: abulafia:/build/t/gcc$ ./cc1 b.c -Os -Wall -quiet -fdump-tree-all abulafia:/build/t/gcc$ ./cc1 b.c -O2 -Wall -quiet -fdump-tree-all But the load from maybe-uninitialized memory is still there. This is lim2: f2 (int * dst, int R) { _Bool inter_I_lsm.3; int inter_I_lsm.2; _Bool inter_I_lsm.1; int inter_I_lsm.0; int inter[2]; int i; <bb 2> [local count: 118111601]: inter_I_lsm.0_16 = inter[0]; // unconditional load outside loop inter_I_lsm.1_17 = 0; inter_I_lsm.2_18 = inter[1]; // unconditional load outside loop inter_I_lsm.3_19 = 0; goto <bb 4>; [100.00%] Reconfirmed, I guess?