Loading...

gcc@gcc.gnu.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: A problem about loop store motion Jiangning Liu Tue Feb 21 01:01:26 2012

> The MEM form is more "canonical", so the loop SM machinery to detect
> equality should be adjusted accordingly.  Alternatively you can teach
> PRE insertion to strip off the MEM if possible (though
> fold_stmt_inplace should
> arelady do this if possible).

Richard,

Thank you! You are right. I noticed on latest trunk the problem in PRE was
already fixed by invoking fold_stmt_inplace.

Unfortunately for this small case, the latest trunk code still can't do SM
for variable pos, because refs_may_alias_p(*D.4074_10, pos) is true, that
is, pos has alias with l[pos].

I think alias analysis should be able to know they don't have alias with
each other, unless there is an assignment statement like "l=&pos;". 

Can alias analysis fix the problem?

Thanks,
-Jiangning

> 
> Richard.
>