https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104601
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- And it ICEs again with -O2 -fno-ipa-pure-const if I add [[gnu::const]] or [[gnu::pure]] attribute to f. The function seems to be const in that it only returns the result and doesn't access any other memory, but the return value does not have a gimple reg type (but is returned in registers on x86_64): _Z1fi: movl $1, -8(%rsp) movb $1, -4(%rsp) movq -8(%rsp), %rax ret And we really should do something to make it movabsq $4294967297, %rax ret or so.