From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C68E238582A1; Fri, 3 Mar 2023 16:18:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C68E238582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677860286; bh=9GynhctIsYl34L4H558P7o1Uw3tbJ5mwbMyX6ErSFe8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oaoXJJXHcyhmyv5aPxZVgDtayLu7iGdB3OX7hYupY6gXpnn2T+ZuE7cWZDZZk7+om XSS+6Ty6ghNKIjlabmVgRSYj2cv1SbqSrdBWkPyE8upSdEW4PoOFw+dJbouVCrmbqJ ogJ6Qh8IbPXeME5LP6s+MlBbQqPV8pW6c5QKs8Xo= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106896] [13 Regression] ICE in to_sreal_scale, at profile-count.cc:339 since r13-2288-g61c4c989034548f4 Date: Fri, 03 Mar 2023 16:18:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106896 --- Comment #10 from Jan Hubicka --- The problem the assert is trying to solve is that local counters are all frequencies relative to the entry block count, while IPA counters are absol= ute values within the whole program. So comparing them mixes apples and oranges. Normally if function has IPA profile, all counts within the function body should be IPA. Problem here is that this that we propagated the fact that function always callls cold function into the entry block but somehow we ma= rk the first basic block as estimated locally which does not make sense. This is inconsistency coming from updates after pcom. We need to live with inconsistent profiles (since it is not always possible= to make them fully right) so I will patch to_sreal to simply give up and retur= n 1 here. That is what we do for unknown probabilities.=