This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/39612] [4.3/4.4/4.5 Regression] LIM inserts loads from uninitialized local memory
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Apr 2009 17:34:38 -0000
- Subject: [Bug tree-optimization/39612] [4.3/4.4/4.5 Regression] LIM inserts loads from uninitialized local memory
- References: <bug-39612-17519@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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