https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128001
Bug ID: 128001
Summary: [OpenMP] Implicit declare target fails with
metadirectives / walk_tree_1 fails to walk
TREE_PURPOSE
Product: gcc
Version: 17.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
Target Milestone: ---
This is for an executable version of
https://github.com/OpenMP/Examples/blob/main/program_control/sources/metadirective.2.f90
Namely one where just the following is added after the main program:
subroutine work_on_chunk(idev, i)
integer :: i, idev
end subroutine
This fails with offloading enabled to link - as 'work_on_chunk' is not marked
as 'declare target'
The code walks with omp_discover_declare_target_fn_r also
'#pragma omp metadirective'
but never looks at the associated tree.
* * *
The problem is that "walk_tree_1" does not walk TREE_PURPOSE!