https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81870

--- Comment #2 from Petr <kobalicek.petr at gmail dot com> ---
I see, so if I understand it correctly then:

1. `__builtin_assume_aligned()` should be used to promote the type to a higher
than natural alignment, for example 16 bytes for easier auto-vectorization.

2. `__attribute__((aligned(N)))` should be used to relax alignment of native
types to lower than natural alignment.

It's interesting that with `__builtin_assume_aligned()` I achieved basically
the same effect as with `__attribute__((aligned(N))`, just the sanitizer is not
happy.

Interestingly, I thought that __builtin_assume_aligned() is basically
equivalent to `__assume_aligned()` provided by Intel and MS compilers.

Anyway thanks for your answer, I need to fix my code a bit.

Reply via email to