https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127850
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Namely, on the C++ side, the check in gcc/cp/decl.cc's
omp_declare_variant_finalize_one needs to pass; it fails if the
user handled the vectorization explicitly as for:
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c
when 'int' should become __v4si for simdlen(4).
GCC's C compiler handles this - but does not do any variant replacement;
GCC's C++ compiler fails since PR 127734 with the error message from above, but
did not do any variant replacement before, either.
* * *
Observations: The following does not seem to happen:
"For procedures with a declare_simd directive, the simd trait is added
to the beginning of the construct trait set as c1 for any generated
SIMD versions so the total size of the trait set is increased by one."
Or it is? Needs more checking.
"The simd trait defines at least the simdlen property and one of the
inbranch or notinbranch properties."
seems as if this is also not happening.
* * *
"Some properties of the simd trait selector have special rules to match
the properties of the simd trait:
• The simdlen(N) property of the trait selector matches the simdlen(M)
trait of the OpenMP context if M is a multiple of N ; and
• The aligned(list:N) property of the trait selector matches the
aligned(list:M) trait of the OpenMP context if N is a multiple of M."
Is seems as if the current code only works if both simdlen are identical
not permitting M being a multiple of N.
And in general:
"The simd trait is a clause-list trait that is defined with properties that
match the clauses that can be specified on the declare_simd directive with
the same names and semantics. The simd trait defines at least the simdlen
property and one of the inbranch or notinbranch properties."
* * *
In any case, it seems as if some auditing is required both for
gomp/simdlen-scaled-4.c
and
gcc/testsuite/c-c++-common/gomp/declare-variant-5.c
And to check the code handling; this part seems to be broken in many ways.