https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77568

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Wilco from comment #0)
> void f3(char *p, int x)
> {
>   if (x & 1) p[0] = 0;
>   if (x & 2) p[1] = 0;
>   if (x & 4) p[2] = 0;
>   if (x & 8) p[2] = 0;
>   g(0,0);
>   if (x & 1) p[3] = 0;
>   if (x & 2) p[4] = 0;
>   if (x & 4) p[5] = 0;
>   if (x & 8) p[6] = 0;
> }

Maybe for the above the instruction selection gimple pass could duplicate the
`x & 1` (etc). and do an `uncse`. 

For other case, maybe the FMA part of the widening pass just needs to be
smarter when it comes to cross over branches because it does handle this just
fine:
```
float g(float x, float y, float z, float *a)
{
        *a=y*z+x;
        return y*z-x;
}
```

Reply via email to