llvm / llvm/llvm-project

[Clang FE] Use of the vector_size attribute allowed with non-power of two sizes.

Open
#175,804 4 comments 0 reactions 0 assignees View on GitHub
clang:frontend
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Clang allows programs like this, with a use of a 3xi64 vector type:

```
typedef long vec_long_24 __attribute__((__vector_size__(24)));
vec_long_24 global_long_24;

extern void passCallee_long_24(vec_long_24 x);

void loadAndPass_long_24(void) {
passCallee_long_24(global_long_24);
}

```

GCC however reports `"error: number of vector components 3 not a power of two"`, per its documentation.

Is this intentional or should clang as well report the error?

@AmrDeveloper @simoll @silvasean @efriedma-quic @nikic @uweigand

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.