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

Alex Richardson <Alexander.Richardson at cl dot cam.ac.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Alexander.Richardson at cl dot 
cam
                   |                            |.ac.uk

--- Comment #5 from Alex Richardson <Alexander.Richardson at cl dot cam.ac.uk> 
---
In clang __builtin_assume_aligned will not be used by the constant expression
evaluator, but it will be used for code generation: for example,

_Bool check(void* x) {
    return __builtin_is_aligned(__builtin_assume_aligned(x, 16), 16);
}

is folded to "return true", but something like

extern int i;
_Static_assert(__builtin_is_aligned(__builtin_assume_aligned(&i, 16), 8), "");
generates an "alignment of the base pointee object (4 bytes) is less than the
asserted 16 byte" error when evaluating __builtin_assume_aligned().

https://godbolt.org/z/96h6j1

Reply via email to