https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113907
--- Comment #43 from Jan Hubicka <hubicka at ucw dot cz> --- > // See discussion here: > // https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571709.html Discussion says: "Once legacy evrp is removed, this won't be an issue, as ranges in the IL will tell the truth. However, this will mean that we will no longer remove the first __builtin_unreachable combo. But ISTM, that would be correct behavior ??." So perhaps, we could remove that special case for default def and phi? It is an odd thing and we clearly lose info here. The problem is that value of parameter i itself does not have global value range [0...10] so I need to compute new SSA name to get it preserved through ipa-split. Maybe ipa-split can be extended to fire up ranger and try to get better value ranges on function parameters from the split function header. Not sure if that is worth the effort though. If we go with merging functions with different ranges, we indeed need to update ranges and bits both in SSA_NAME infos and in ipa-prop's jump functions. At the time sem_fuction::merge calls ipa_merge_profiles we do have both function bodies in memory and thus we can do the job. If we just drop the info instead of merging, we do limited harm on SSA_NAME infos since they mostly will be recomputed again. For ipa-prop this may cause more interesting precision loss. So perhaps for backportability we may want to just limit ICF to functions wth same ranges in SSA_NAME infos. Let me cook up a patch and see if there is significant loss in merged functions. I think it should be quite small given that ranges seem to only diverge through ipa-split in very specific cases for now. (and given how much time I spent on producing the testcase)