Landing: e2e54655d9d6

Project / Subsystem

gcc / openmp

Date

2026-07-16

Author

Tobias Burnus

Commit

e2e54655d9d655bdef42a2c9eadb81dfdf88e1c7

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
openmp
patch_id
commit_hash
e2e54655d9d655bdef42a2c9eadb81dfdf88e1c7
source_type
github
headline
OpenMP: Fix implicit declare target behavior for host offloading
tldr
Corrects OpenMP's handling of 'device_type(host)' in target regions to prevent unintended device code generation.
author
Tobias Burnus
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • openmp
  • offloading
  • fortran
discussion_id_link
bugzilla_pr
date
2026-07-16T00:00:00.000Z

This change fixes a bug in OpenMP’s handling of target regions that use ‘device_type(host)’ or ‘device(ancestor:1)’. Previously, device code could still be generated in these cases. The fix adjusts the condition in omp_discover_declare_target_tgt_fn_r to ensure that no device code is generated when the host is explicitly targeted, aligning with the intended behavior and resolving a failing test case.