https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118681
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=120952 --- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- Thanks. I was already thinking we should do this first: alignment = std::bit_ceil(alignment); to be safe against callers that violate the precondition to pass a valid alignment, and then we know it's a power of two. And with your version, we're not affected by GCC's missed-optimization (filed as Bug 120952).