GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
openmp

openmp: Add OMPT variant of GOMP_has_masked_thread_num

Introduces a new OpenMP function variant for OMPT tracing.

A new OpenMP built-in function, GOMP_has_masked_thread_num_with_end, has been added. This function is semantically identical to GOMP_has_masked_thread_num but is specifically intended for use with the -fopenmp-ompt flag, which enables OpenMP Thread Tracing (OMPT). The change involves adding the new builtin definition, using it in the lower_omp_master lowering pass when OMPT is enabled, and updating libgomp to declare and implement the new function.

In Details

This commit introduces BUILTIN_GOMP_HAS_MASKED_THREAD_NUM_WITH_END and its implementation in libgomp to support OpenMP Thread Tracing (OMPT). The lower_omp_master pass in GCC now selects this new builtin when the -fopenmp-ompt flag is present. This provides a hook for OMPT tools to query information related to masked thread numbers, distinct from the regular OpenMP runtime.

For Context
OMPT
OpenMP Thread Tracing. An interface that allows external tools to trace and analyze the execution of OpenMP programs.
GOMP
The GCC OpenMP runtime library.
builtin function
Functions recognized and potentially optimized by the compiler directly, without needing a separate library call in some cases.
lowering pass
A compiler optimization pass that transforms high-level intermediate representation into a lower-level one, closer to machine code.
Filed Under: openmpompttracing