GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/fortran

OpenMP: Fortran target update constructs now support iterators

GCC's Fortran front-end now allows the use of iterators within the 'to' and 'from' clauses of OpenMP 'target update' directives, improving flexibility for offl…

This update to the Fortran front-end in GCC introduces support for iterators in OpenMP ‘target update’ constructs. Previously, iterators were not permitted in the ‘to’ and ‘from’ clauses of these directives. This enhancement allows Fortran developers to use iterative constructs for specifying data transfer to and from target devices, providing more expressive and potentially more efficient data management in parallel regions.

In Details

This change modifies several files within gcc/fortran, particularly dump-parse-tree.cc, match.cc, openmp.cc, and trans-openmp.cc, to properly parse, resolve, and translate iterator modifiers within OMP_LIST_TO and OMP_LIST_FROM clauses of OpenMP target update directives. The trans-openmp.cc also now adds expressions to iter_block instead of block, indicating a shift in how these iterative structures are handled in the intermediate representation. Toolchain developers should note the expanded gfc_match_motion_var_list and resolve_omp_clauses functions which now explic…

For Context

This update to GCC's Fortran compiler improves how Fortran programs can use OpenMP, a set of directives for parallel programming. Specifically, it affects 'target update' directives, which are used to manage data movement between the main processor and an accelerator (like a GPU). Before this change, when you wanted to specify which parts of an array or data structure should be moved, you had to list them directly. Now, Fortran users can employ 'iterators' in these directives, which are like loop variables that let the compiler understand a pattern of data to move. This makes it easier to transfer complex data structures efficiently, potentially speeding up scientific and high-performance computing applications by giving more control over data offloading.

Filed Under: openmpfortranoffloadingiterators