This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59616] OpenMP standard conflict in parallel default clause
- From: "adam at adamvoysey dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Mar 2015 21:23:35 +0000
- Subject: [Bug c/59616] OpenMP standard conflict in parallel default clause
- Auto-submitted: auto-generated
- References: <bug-59616-4 at http dot gcc dot gnu dot org/bugzilla/>
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)
^