https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99677
--- Comment #2 from cqwrteur <unlvsur at live dot com> --- Even with [[gnu::pure]] clang does not emit code either. https://godbolt.org/z/e4sG6r We can see it emits code only when we do not mark the functions are pure. https://godbolt.org/z/s3cEK3 That is not the case for GCC. [[gnu::pure]] is a GCC attribute but clang does things better. So sad :(