[Bug fortran/118955] Fortran uses vector math functions without -ffast-math
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 27 11:46:10 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118955
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Wilco Dijkstra <wilco@gcc.gnu.org>:
https://gcc.gnu.org/g:66a2e7137049482ac317a5af8d64f43c315f87a6
commit r16-7066-g66a2e7137049482ac317a5af8d64f43c315f87a6
Author: Wilco Dijkstra <wilco.dijkstra@arm.com>
Date: Wed Sep 17 15:50:04 2025 +0000
fortran: Allow vector math functions only with fast-math [PR 118955]
Vector math functions are currently always enabled in Fortran. This is
incorrect since vector math functions are designed to be Ofast only.
Add a new 'fastmath' option which only accepts vector functions if
fast-math
is enabled:
!GCC$ builtin (sin) attributes simd (notinbranch) if('fastmath')
gcc/fortran:
PR fortran/118955
* decl.cc (gfc_match_gcc_builtin): Add 'fastmath' option which
checks for fast-math before accepting a vector function.
* gfortran.texi (!GCC$ builtin): Update documentation.
gcc/testsuite:
PR fortran/118955
* gfortran.dg/simd-builtins-9.f90: Add new test.
* gfortran.dg/simd-builtins-9.h: Likewise.
More information about the Gcc-bugs
mailing list