https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122959
Bug ID: 122959
Summary: [16 Regression] Wrong-code with nvptx-offload
r16-5780-g65a3849eb46df2 (vect: early break forced
live IVs as scalar)
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: openmp, wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
CC: tamar.christina at arm dot com
Target Milestone: ---
Target: nvptx
Created attachment 62967
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62967&action=edit
test.f90 – compile with '-fopenmp' and enabled nvptx offloading.
r16-5780-g65a3849eb46df2
vect: support vectorization of early break forced live IVs as scalar
Causes several offloading failures with OpenMP_VV,
https://github.com/OpenMP-Validation-and-Verification/OpenMP_VV/
at least when offloading to nvptx:
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_data_map_components_default.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_data_map_components_from.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_data_map_components_to.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_data_map_components_tofrom.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_enter_data_components_alloc.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_enter_data_components_to.F90
execute -O3
PASS -> FAIL: openmp_vv.sum:4.5 - test_target_map_components_default.F90
execute -O3
* * *
In particular, the attached simplified testcase fails with -O3 (but not -O2):
$ gfortran -fopenmp test2.f90 -O3 && ./a.out
100 0
STOP 1
Namely, the last element of the 100-element array has the initial value 0
instead of the expected value 10.
The extra entries in the derived type are required, if I remove some, it starts
passing. (I can remove some, but not many.)