https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83330
--- Comment #6 from Zdenek Sojka <zsojka at seznam dot cz> --- (In reply to Jakub Jelinek from comment #1) > (In reply to Zdenek Sojka from comment #0) > > Also, I do not understand why bar() is apparently inlined, when the function > > bar isn't inlined. Instead ipa-pure-const determines it is a const function > and because nothing really needs its return value, it is just not called at > all. Thank you for the explanation. That also explains why -fno-ipa-pure-const prevents removing the call. > > > has noinline,noclone attributes (noipa helps; -fno-ipa-pure-const helps > > too); but "noipa" implies just noinline,noclone,no_icf according to > > https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common- > > Function-Attributes > > No, it doesn't say anything like that. It says it implies those attributes, > but is not a mere union of those 3 attributes, but disables many other IPA > optimizes between that function and the callers. > E.g. mere noinline, noclone, no_icf doesn't disable IPA VRP, or IPA bitwise > CCP, etc. I am sorry, I totally misread the description, so it had the very opposite meaning. Thank you for the comment.