https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87525
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mjambor at suse dot cz --- Comment #14 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Still does not reproduce for trunk to me, but reproduces with gcc 8. The problem is that ipa-cp decides to clone fread which is extern inline and then redirect all calls to the clone that makes is self recursive. Martin, it seems to me that ipa-cp should not clone extern inline functions unless it sees that it helps to clone some real functions called from it. Why the costmodel thinks it is profitable? Evaluating opportunities for fread/21. - considering value 1 for param #1 size_t (caller_count: 2) good_cloning_opportunity_p (time: 3, size: 33, freq_sum: 9514, scc) -> evaluation: 518, threshold: 500 Creating a specialized node of fread/21. adding an extra known scalar value 10 for param #2 size_t cannot change function signature replacing param #1 size_t with const 1 replacing param #2 size_t with const 10 Accounting size:4.00, time:4.00 on predicate exec:(true) Accounting size:3.00, time:2.00 on new predicate exec:(not inlined) the new node is fread.constprop/37. This is more or less design issue of the FORTIFY_SOURCE. I suppose I can try to teach ultimate_alias_target and friends to not walk into external inline function unless it is called directly. This will more immitate to what GCC traditionally did before it had symbol table.