This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/20367] alias analysis doesn't take into account that variables that haven't their address taken can't alias arbitrary MEMs


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]