[PATCH] D102064: Parse vector bool when stdbool.h and altivec.h are included

Ulrich Weigand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 11 10:09:07 PDT 2021


uweigand added a comment.

In D102064#2751089 <https://reviews.llvm.org/D102064#2751089>, @ZarkoCA wrote:

> In D102064#2751001 <https://reviews.llvm.org/D102064#2751001>, @uweigand wrote:
>
>> This means the implementation now deviates from the documented vector extension syntax, right?   I guess it's strictly an extension of the documented syntax, but that may still lead to incompatibilities with other compilers for the platform.  If we want to make such a change, should it be synchronized with e.g. GCC, XL, etc. ?
>
> GCC and XL already accept this syntax on Linux on Power and AIX.
>
> For example this simple test case:
>
>   #include <stdbool.h>
>   #include <altivec.h>
>   
>   vector bool char bc;
>
> Can compile with GCC 9/10 and XLC 16.1 on Linux on Power. On AIX, GCC 8.3 on AIX and XLC 16.1 can also compile it successfully.  Latest main trunk clang throws up an error on those platforms.
>
> From offline conversation it looks like XLC on z/OS can also compile the test case. @Everybody0523 can confirm for sure.

Interesting.   On Z using GCC I currently get this error:

  vbool.c:2:1: error: invalid vector type for attribute ‘vector_size’
      2 | vector _Bool x;

But looking at the GCC sources, it seems we actually intended to support this use as well, there's just a bug.   Given that, I think I'd be fine with adding this to LLVM -- I'll make sure the GCC bug gets fixed as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102064/new/

https://reviews.llvm.org/D102064



More information about the cfe-commits mailing list