[cfe-dev] Clang ms_abi - vectorcall incompatible?

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 9 05:29:15 PST 2018


On Fri, Mar 9, 2018 at 2:28 AM, via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> Hello Clang-Dev-People,
>
> currently I'm experimenting with the different target-triples which Clang
> supports. My current target is: "x86_64-unknown-linux-gnuabi64-elf"
> When I write the following code:
>
> int __attribute__((ms_abi, vectorcall)) printf(const char*, ...);
>
> void printAll(double x, int y, double z, int x2, int y2, double z2)
> {
>         printf("First message!\n");
>         printf("%f %i %f %i %i %f\n", x, y, z, x2, y2, z2);
> }
>
> The compiler responses:
> "vectorcall and ms_abi attributes are not compatible"
>
> I understand the error - but why? What should I do when I want to use the
> vectorcall windows x86_x64 calling convention?

Clang is diagnosing because it treats ms_abi and vectorcall as both
being calling convention attributes and the conventions don't match.
We give the same diagnostic if you attempt to add both stdcall and
cdecl calling conventions to the function. This happens in
handleFunctionTypeAttr() from SemaType.cpp.

GCC accepts ms_abi and vectorcall on the same declaration, so it would
be reasonable for us to do the same. Would you be willing to file a
bug in Bugzilla so we don't lose track of this?

~Aaron

>
> Kind regards
> Björn
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
> Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list