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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-06-23

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Yes, happens with the current master.

Reduced test-case:

$ cat pr101170.c
struct gomp_doacross_work_share GOMP_doacross_ull_wait_ws_1_0;
__builtin_va_list GOMP_doacross_ull_wait_ap;
int GOMP_doacross_ull_wait_i;
long long GOMP_doacross_ull_wait_flattened;
struct gomp_doacross_work_share {
  int ncounts;
  int shift_counts[];
};

struct gomp_doacross_work_share
doacross_spin(int expected) {
  struct gomp_doacross_work_share a;
  do
    if (expected)
      return a;
  while (1);
}

void
GOMP_doacross_ull_wait() {
  for (; GOMP_doacross_ull_wait_i; GOMP_doacross_ull_wait_i++)
    GOMP_doacross_ull_wait_flattened |=
        __builtin_va_arg(GOMP_doacross_ull_wait_ap, long long)
        <<
GOMP_doacross_ull_wait_ws_1_0.shift_counts[GOMP_doacross_ull_wait_i];
  if (GOMP_doacross_ull_wait_flattened)
    doacross_spin(GOMP_doacross_ull_wait_flattened);
}

Reply via email to