On 11/22/20 6:35 PM, Eugene Rozenfeld via Gcc-patches wrote:
> Simplify
> ((b | c) & a) | b
> to
> (a & c) | b.
>
> This fixes PR96679.
>
> Tested on x86_64-pc-linux-gnu.
>
> int f(int a, int b, int c)
> {
> return ((b | c) & a) | b;
> }
>
> Code without the patch:
> or edx,esi
> and
Simplify
((b | c) & a) | b
to
(a & c) | b.
This fixes PR96679.
Tested on x86_64-pc-linux-gnu.
int f(int a, int b, int c)
{
return ((b | c) & a) | b;
}
Code without the patch:
or edx,esi
andedx,edi
moveax,edx
or eax,esi
ret
Code with the patch:
andedi,edx
moveax,edi