]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix verification ICE after ipa-cp
authorJan Hubicka <hubicka@ucw.cz>
Thu, 18 Sep 2025 12:15:47 +0000 (14:15 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Thu, 18 Sep 2025 12:16:30 +0000 (14:16 +0200)
commit8c6b6adce45a550c52dc35e3df4e0c477f5404fa
treeb1cfc8909d2cec901356e92c83f6fc633bda5b9a
parentd5e80bf7571836bb307f38e45f0e6ba392cdcc3d
Fix verification ICE after ipa-cp

I managed to reproduce the ICE.  The error is verification error about
callgraph edge count being different from basic block count of the
corresponding call stmt.  This verification is only done for local profiles,
since IPA profiles are scaled during inlining, cloning and other
transformations.

Ipa-cp has logic special casis self recursive functions and it adjust
probability of the recursion to avoid non-sential IPA profiles.  Normally
this is not done for local profiles, however in case the IPA profile
is broken enought the earlier logic will push clone profiles to be local
which in turn causes the verifier error.

This patch simply disables the update.  Its main purpose is to keep IPA
profile seemingly meaningful and the upate is never applied back to
gimple code.  Alternative would be to add machinery to adjust frequencies
of call edges, but I do not think it is worth the effort at this moment.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

* ipa-cp.cc (update_counts_for_self_gen_clones): Do not update
call frequency for local profiles.
gcc/ipa-cp.cc