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: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Apr 2009 18:44:49 -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 #6 from rguenther at suse dot de 2009-04-26 18:44 -------
Subject: Re: [4.3/4.4/4.5 Regression] LIM
inserts loads from uninitialized local memory
On Sun, 26 Apr 2009, rakdver at gcc dot gnu dot org wrote:
> ------- Comment #5 from rakdver at gcc dot gnu dot org 2009-04-26 18:37 -------
> (In reply to comment #4)
> > 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.
>
> Right. The initial value of inter may reach the call to foo (when R <= 1), so
> we must issue (and keep) the loads if we want to perform lsm without loop
> header copying. While I recognize that adding the loads from (possibly)
> uninitialized memory is somewhat annoying, limiting lsm only to loops where we
> can prove that this does not happen does not make much sense, either.
Ok. I guess setting TREE_NO_WARNING on the inserted loads could avoid
the uninitialized warning in 4.4.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39612