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

Adam Voysey <adam at adamvoysey dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adam at adamvoysey dot co.uk

--- Comment #1 from Adam Voysey <adam at adamvoysey dot co.uk> ---
I think this is the correct behaviour for gcc 4.8.2, because this version
implements version 3.1 of the OpenMP specification.

Section 2.9.1.1 of version 3.1 (and indeed version 3.0 as well) of the OpenMP
specification contains the following statement: -

 * Variables with const-qualified type having no mutable member are shared

which is deleted from the 4.0 version.

*However*, this does mean this is incorrect behaviour - as far as I can see -
for version 4.9.0 of gcc and later, which similarly display the same error
dispite implementing version 4.0 of the OpenMP specification.

In fact, given this example (and probably others) are incompatible between
version 4.0 of OpenMP specification and version 3.1/3.0, should there be some
way to specify which version of OpenMP you wish to use? e.g. being able to set
-fopenmp=3.1 equivalent to how one can set -std=c99

Output from gcc versions I have installed: 

gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu11): - 

test_ompmin.c: In function ‘test_omp’:
test_ompmin.c:12:68: error: ‘b’ is predetermined ‘shared’ for ‘shared’
     # pragma omp parallel for schedule(static) default(none) shared(a,b,c)
                                                                    ^


gcc version 5.0.0 20150321 (experimental) [trunk revision 221551] (Ubuntu
5-20150321-1ubuntu12): -

test_ompmin.c: In function ‘test_omp’:
test_ompmin.c:12:68: error: ‘b’ is predetermined ‘shared’ for ‘shared’
     # pragma omp parallel for schedule(static) default(none) shared(a,b,c)
                                                                    ^

Reply via email to