[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread Alexander.Richardson at cl dot cam.ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #8 from Alex Richardson --- (In reply to Jakub Jelinek from comment #3) > I guess I have big questions on what exactly will it do during constexpr > evaluation - if it is on a pointer to object with certain alignment, for > smaller

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #7 from Jakub Jelinek --- (In reply to Alex Richardson from comment #5) > extern int i; > _Static_assert(__builtin_is_aligned(__builtin_assume_aligned(, 16), 8), > ""); > generates an "alignment of the base pointee object (4 bytes)

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread Alexander.Richardson at cl dot cam.ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #6 from Alex Richardson --- (In reply to Jakub Jelinek from comment #3) > assume_aligned is something different, I guess __builtin_is_aligned expands > to an actual runtime check (perhaps optimized away if the pointer can't be >

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread Alexander.Richardson at cl dot cam.ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 Alex Richardson changed: What|Removed |Added CC||Alexander.Richardson at cl dot cam

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #4 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #3) > assume_aligned is something different, I guess __builtin_is_aligned expands > to an actual runtime check (perhaps optimized away if the pointer can't be >

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #2 from Jonathan Wakely --- We could make immediate use of these in libstdc++. We have std::align and std::assume_aligned in include/bits/align.h, and aligned_ceil in src/c++17/memory_resource.cc, and a couple of places in

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 Richard Biener changed: What|Removed |Added Severity|normal |enhancement Version|unknown

[Bug c++/98641] Feature request: implement pointer alignment builtins

2021-01-12 Thread ktkachov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98641 --- Comment #1 from ktkachov at gcc dot gnu.org --- The component is marked as C++, but it would be good to have these in C as well.