------- Comment #4 from rguenth at gcc dot gnu dot org 2009-04-26 17:34 ------- void foo(int *); void f2(int dst[3], int R) { int i, inter[2];
for (i = 1; i < R; i++) { inter[0] = 1; inter[1] = 1; } foo(inter); } Warns at -Os or also at -O2 if you disable loop header copying. So maybe we should avoid doing loads from local memory in places we do not know will be executed. On trunk simply the warning doesn't work anymore, the loads are still there, same for 4.3. The loads are not removed by any pass (without loop header copying) and the loop remains. Note that even with -Os -ftree-ch no loop header copying is performed. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |4.2.4 Summary|[4.4/4.5 Regression] |[4.3/4.4/4.5 Regression] LIM |Incorrect warning issued Re |inserts loads from |variable *is* used |uninitialized local memory |uninitialized in this | |function | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39612