[Patch] Fortran: Store OpenMP's 'declare variant' in module file [PR115271]

Tobias Burnus tburnus@baylibre.com
Fri Mar 14 14:35:59 GMT 2025


Attached is a long overdue bug fix, given that OpenMP's declare variant
is supported in gfortran sincer12-4409-g724ee5a0093da4 (Oct 2021). (and in C/C++ since 
r10-3744-g94e7f906ca5c73, Oct 2019). While 'omp declare simd' was 
already handled in the .mod file, 'declare variant' was not. It is 
easily missed in single-file testcases (esp. after the 
commitr15-7595-g8268c8256) as the
whole-file handling mostly hides it.
It is also not directly visible in real-world code as the base
function usually works, albeit not as good as the variant
(hence, there is variant).I hope that I have covered everything that is needed, but I am sure that 
there are bugs lurking. Hence, I wouldn't mind if someone would glance 
at it - or even proof read it. Tested on x86-64-gnu-linux. Comments, 
remarks, suggestions before I eventually commit it relatively soonish? 
Tobias PS: I think we should also eventually add some more testcases 
like for the device or target_device selectors sets; I also have not 
used the 'condition' selector or ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-fortran-mod-file.diff
Type: text/x-patch
Size: 29455 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250314/4df8c7fc/attachment-0001.bin>


More information about the Fortran mailing list