Hi,

On Wed, 16 Nov 2011, Jeff Law wrote:

> Right.  In theory, path isolation would make this optimizable.  Make a 
> copy of the block containing a[x] = 2 and make it the target when x != 
> 100.  At the source level it'd look something like this:
> 
>  int x;
>  extern void f(void);
> 
>  void g(int *a)
>  {
>         a[x] = 1;
>         if (x == 100) {
>                 f();
>               a[x] = 2;
>       } else {
>               a[x] = 2;
>       }
>  }
> 
> 
> The problem then becomes identification of the load from "x" as
> redundant on the else path, which we're currently not capable of doing.

Also in this variant the first store to a[x] may-clobbers x itself.  The 
function call doesn't enter the picture.


Ciao,
Michael.

Reply via email to