Re: [PATCH] middle-end: Optimize (A&C)^(B&C) to (A^B)&C in simplify_rtx.

2020-06-12 Thread Richard Sandiford
"Roger Sayle" writes: > diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c > index 28c2dc6..ccf5f6d 100644 > --- a/gcc/simplify-rtx.c > +++ b/gcc/simplify-rtx.c > @@ -3128,6 +3128,17 @@ simplify_binary_operation_1 (enum rtx_code code, > machine_mode mode, >mo

[PATCH] middle-end: Optimize (A&C)^(B&C) to (A^B)&C in simplify_rtx.

2020-06-11 Thread Roger Sayle
My apologies in advance for a middle-end patch without a test case. The patch below implements a simple/safe missing transformation in the RTL optimizers, that transforms (A&C)^(B&C) into the equivalent (A^B)&C, when C doesn't side-effect, such as a constant. I originally identified this