[Bug rtl-optimization/20367] alias analysis doesn't take into account that variables that haven't their address taken can't alias arbitrary MEMs
dnovillo at redhat dot com
gcc-bugzilla@gcc.gnu.org
Tue Mar 8 01:36:00 GMT 2005
------- Additional Comments From dnovillo at redhat dot com 2005-03-08 01:36 -------
Subject: Re: alias analysis doesn't take into
account that variables that haven't their address taken can't alias arbitrary
MEMs
pinskia at gcc dot gnu dot org wrote:
> void g();
> int
> f(int s, int *a)
> {
> static int i;
> for (i = 0; i < 800; i++)
> {
> g();
> s += a[i];
> }
> return s;
> }
>
> But all of this needs to be on the tree level to be really effective.
>
This particular case is trivial to fix inside the tree optimizers.
Variable 'i' is a local variable with static storage that is not upward
exposed (i.e., it has no default definition).
Once you recognize that, you can safely flip the TREE_STATIC bit on the
variable and expose it as a gimple register.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20367
More information about the Gcc-bugs
mailing list