https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104434
--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> --- On rereading https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html I think that "pure" isn't strong enough for the above example: the result of a pure function is allowed to change between invocations with the same inputs. I think the function needs to be "const".