https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- The reason why gcc warns is that it is unable to prove that the function is always finite. This means that it can not auto-detect pure attribute since optimizing the call out may turn infinite program to finite one. So adding the attribute would still help compiler to know that the loops are indeed finite.