https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68707
--- Comment #21 from alalaw01 at gcc dot gnu.org --- Here's the smallest testcase I could come up with (where SLP gets cancelled, but we end up with fewer st2's than before)...the key seems to be things being used in multiple places. #define N 1024 int in1[N], in2[N]; int out1[N], out2[N]; int w[N]; void foo() { for (int i = 0; i < N; i+=2) { int a = in1[i] & in2[i]; int b = in1[i+1] & in2[i+1]; out1[i] = a; out1[i+1] = b; out2[i] = (a + w[i]) ^ (b+w[i+1]); out2[i+1] = (b + w[i]) ^ (a+w[i+1]); } }