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

--- Comment #6 from Arsène Pérard-Gayot <perard at cg dot uni-saarland.de> ---
(In reply to Jakub Jelinek from comment #5)
> Created attachment 46018 [details]
> gcc9-pr89796.patch
> 
> Untested fix.
> 
> You could have used simpler
> #pragma omp atomic capture
> prev = c++;
> that wouldn't warn (so, if you want a workaround, use that).

Thank you for the workaround. Sadly, I cannot apply it to my problem, because
in my original code, the increment is not one. I need to do something like:

  #pragma omp atomic capture
  { prev = counter; counter += K; }

Reply via email to