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

--- Comment #1 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
Not only inorder reduction.


But also un-order reduction:

https://godbolt.org/z/sn5jbWPbd

#include <stdint.h>
int
foo (int16_t * __restrict a, int n, int * __restrict cond)
{
  int r = 0;
  for (int i = 0; i < 8; i++)
     if (cond[i])
      r += a[i];
   return r;
}

int
foo2 (int16_t * __restrict a, int n, int * __restrict cond)
{
  int r = 0;
  for (int i = 0; i < 8; i++)
      r += a[i];
   return r;
}

Failed to combine into widen reduction

Reply via email to