On Sun, Aug 24, 2025 at 08:16:32PM -0600, Sandra Loosemore wrote: > As noted in PR middle-end/121630, GCC seems to think that the "simd" > construct selector on "declare variant" implies that the variant > function accepts vectorized arguments, although this is not anywhere > in the OpenMP specification.
It does imply that. See e.g. OpenMP 5.1 "Any differences that the specific OpenMP context requires in the prototype of the variant from the base function prototype are implementation defined." and "The function variant is determined by base language standard name lookup rules ([basic.lookup]) of variant-func-id using the argument types at the call site after implementation-defined changes have been made according to the OpenMP context." While the transformation of the argument types is just implementation-defined, it has always been the intent when declare simd has been introduced that simd trait will be treated like that on compilers with some kind of vector ABI and the reason why various simd related restrictions exist for declare variant: "The match clause of a begin declare variant directive may not contain a simd trait-selector-name." and "The context selector that appears in a when clause must not specify any properties for the simd selector." etc. Plus the fact that for simd one needs to specify simdlen and inbranch or notinbranch and can specify other properties like uniform/linear etc., without argument transformations those would be kind of moot for declare variant. The intent has always been that the types will be transformed according to the declare simd ABI rules, declare variant is meant to be in that case as a way to optionally redirect calls to the vector ABI functions written by hand. One needs to provide simdlen Yes, GCC doesn't have it implemented fully, but that doesn't mean it should be ripped off, the implementation should be simply finished. Jakub