Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 478870[details]
Code that shows the problem
Description of problem:
The attached code results in the following compiler error:
main.cpp: In function ‘int main(int, char**)’:
main.cpp:22: error: ‘values’ is predetermined ‘shared’ for ‘shared’
Version-Release number of selected component (if applicable):
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)
How reproducible:
Compile the attached program using this command:
g++ -c -o main.o -fopenmp -pipe -Wall -Wextra main.cpp
Actual results:
The above compiler error.
Expected results:
The code should compile. It compiles, if the "const" in line 17 is removed. It also compiles using gcc 4.1 under RHEL5.
Additional info:
See OpenMP 3.0 standard, section 2.9.1.1, line 19 on page 78:
"Variables with const-qualified type having no mutable member are shared."
and lines 1-7 on page 79:
"Variables with predetermined data-sharing attributes may not be listed in data-sharing attribute clauses, except for the cases listed below. For these exceptions only, listing a predetermined variable in a data-sharing attribute clause is allowed and overrides the variable’s predetermined data-sharing attributes.
C/C++
The loop iteration variable(s) in the associated for-loop(s) of a for or parallel
for construct may be listed in a private or lastprivate clause.
Therefore your testcase is not valid OpenMP program and it is correct that GCC rejects it. Just remove the const var from shared clause.
Created attachment 478870 [details] Code that shows the problem Description of problem: The attached code results in the following compiler error: main.cpp: In function ‘int main(int, char**)’: main.cpp:22: error: ‘values’ is predetermined ‘shared’ for ‘shared’ Version-Release number of selected component (if applicable): gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) How reproducible: Compile the attached program using this command: g++ -c -o main.o -fopenmp -pipe -Wall -Wextra main.cpp Actual results: The above compiler error. Expected results: The code should compile. It compiles, if the "const" in line 17 is removed. It also compiles using gcc 4.1 under RHEL5. Additional info: