]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: fmv: Prevent FMV being combined with other cloning/renaming extensions.
authorAlfie Richards <alfie.richards@arm.com>
Tue, 30 Sep 2025 12:25:25 +0000 (12:25 +0000)
committerAlfie Richards <alfie.richards@arm.com>
Thu, 2 Oct 2025 08:29:07 +0000 (08:29 +0000)
commit264a575765e0985fdc8a00b16c1d5bb4a46ed4db
treeb267b8c9de23d847d4d52d1d335a30d8d4d8cfe4
parent8cf1bc6b5d561458bbad85505f59ab85a65932c4
c: fmv: Prevent FMV being combined with other cloning/renaming extensions.

This patch adds exclusions and diagnostics to prevent function multi-versioning
being used with omp simd pragmas and renaming extensions.

This behaviour is forbidden by the ACLE as the expected behaviour is not clear.

gcc/c-family/ChangeLog:

* c-attribs.cc (attr_target_clones_exclusions): Add simd and omp
exclusions.
(attr_target_version_exclusions): New definition with simd and omp
exclusions.
(attr_omp_declare_simd_exclusions): New definition with target_version
and clones exclusions.
(attr_simd_exclusions): Ditto.
(c_common_gnu_attributes): Add new target_version, simd, and omp
declare simd variables.

gcc/c/ChangeLog:

* c-decl.cc (maybe_mark_function_versioned): Add diagnostic.
* c-parser.cc (c_finish_omp_declare_simd): Add diagnostic.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/mv-error11.c: New test.
* gcc.target/aarch64/mv-error12.c: New test.
gcc/c-family/c-attribs.cc
gcc/c/c-decl.cc
gcc/c/c-parser.cc
gcc/testsuite/gcc.target/aarch64/mv-error11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/mv-error12.c [new file with mode: 0644]