[Bug c/50675] master and single OpenMP constructs broken

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Oct 9 13:42:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50675

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-09 13:41:54 UTC ---
User error.  The i variable is shared in your testcase, thus different threads
may encounter #pragma omp single different number of times, which is invalid.
Just use #pragma omp parallel private (i) or declare i inside of the #pragma
omp parallel block instead.



More information about the Gcc-bugs mailing list