clang-omp / clang

clang with OpenMP 3.1 and some elements of OpenMP 4.0 support
clang-omp.github.com
Other
91 stars 15 forks source link

Rejecting forms in atomic read/write that should be permitted #45

Open ghost opened 9 years ago

ghost commented 9 years ago

Here's the output --

helpers.c:986:23: error: statement form is not allowed for '#pragma omp atomic read' ATOMIC_READ_CHAR (n = task[t].info.needed); ^ helpers.c:140:3: note: expanded from macro 'ATOMIC_READ_CHAR' stmt; \ ^ helpers.c:1024:22: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_out = (untaken_out + 1) & QMask); ^ helpers.c:148:3: note: expanded from macro 'ATOMIC_WRITE_CHAR' stmt; \ ^ helpers.c:2092:24: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_in = (untaken_in+1) & QMask); ^ helpers.c:148:3: note: expanded from macro 'ATOMIC_WRITE_CHAR' stmt; \ ^ helpers.c:2099:24: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_in = (untaken_in+1) & QMask);


And here's an example of the macros:

define ATOMIC_READ_CHAR(stmt) do { \

_Pragma("omp atomic read") \ stmt; \ } while (0)

endif

alexey-bataev commented 9 years ago

Hi, Thanks for the report. What are the types for n, task[t].info.needed, untaken_out, QMask? Could you provide a piece of code, so I could try to reproduce it myself?

Best regards,

Alexey Bataev

Software Engineer Intel Compiler Team Intel Corp.

10.10.2014 9:06, justsomeone1001 пишет:

Here's the output --

helpers.c:986:23: error: statement form is not allowed for '#pragma omp atomic read' ATOMIC_READ_CHAR (n = task[t].info.needed); ^ helpers.c:140:3: note: expanded from macro 'ATOMIC_READ_CHAR' /stmt/; \ ^ helpers.c:1024:22: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_out = (untaken_out + 1) & QMask); ^ helpers.c:148:3: note: expanded from macro 'ATOMIC_WRITE_CHAR' /stmt/; \ ^ helpers.c:2092:24: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_in = (untaken_in+1) & QMask); ^ helpers.c:148:3: note: expanded from macro 'ATOMIC_WRITE_CHAR' /stmt/; \ ^ helpers.c:2099:24: error: statement form is not allowed for '#pragma omp atomic write' ATOMIC_WRITE_CHAR (untaken_in = (untaken_in+1) & QMask);


And here's an example of the macros:

define ATOMIC_READ_CHAR(/stmt/) do { \

/Pragma("omp atomic read") \ _stmt/; \ } while (0)

endif

— Reply to this email directly or view it on GitHub https://github.com/clang-omp/clang/issues/45.

ghost commented 9 years ago

Sure - if you give me your e-mail I'll just send you the source file. It's not long.

ghost commented 9 years ago

Well it is long, but the part that doesn't work is at the top.