Summary: | [11 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340 | ||
---|---|---|---|
Product: | gcc | Reporter: | Sergei Trofimovich <slyfox> |
Component: | gcov-profile | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dimhen, herrtimson, marxin |
Priority: | P2 | Keywords: | ice-on-valid-code |
Version: | 12.0 | ||
Target Milestone: | 11.4 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2022-04-19 00:00:00 | |
Attachments: | 0001-gcov-profile-Allow-negative-counts-of-indirect-calls.patch |
Description
Sergei Trofimovich
2022-04-15 06:41:01 UTC
Relevant bit of counters dump for completeness (after merge): $ gcov-dump -l a.gcda ... a.gcda: 01a90000: 528:COUNTERS indirect_call 66 counts a.gcda: 0: -50 32 1456173180 1 1792104613 1 918340114 1 a.gcda: 8: 1406444659 1 263798468 1 1664310260 1 1063174467 1 a.gcda: 16: 1596551981 1 54847898 1 533075953 1 1135316294 1 a.gcda: 24: 601636648 1 2142348703 1 450479102 1 1186224457 1 a.gcda: 32: 416313568 1 1153296983 1 617240633 1 2024260238 1 a.gcda: 40: 1680162021 1 944285266 1 1480528956 1 72519307 1 a.gcda: 48: 1631250666 1 1029141085 1 941945699 1 1682532820 1 a.gcda: 56: 71228346 1 1481851149 1 1154596710 1 414983633 1 a.gcda: 64: 2026608575 1 Proposed the fix as https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg283031.html Created attachment 52819 [details]
0001-gcov-profile-Allow-negative-counts-of-indirect-calls.patch
(In reply to Sergei Trofimovich from comment #2) > Proposed the fix as > https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg283031.html Next time, please use our official mailing list: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593287.html The master branch has been updated by Sergei Trofimovich <slyfox@gcc.gnu.org>: https://gcc.gnu.org/g:90a29845bfe7d6002e6c2fd49a97820b00fbc4a3 commit r12-8199-g90a29845bfe7d6002e6c2fd49a97820b00fbc4a3 Author: Sergei Trofimovich <siarheit@google.com> Date: Fri Apr 15 08:35:27 2022 +0100 gcov-profile: Allow negative counts of indirect calls [PR105282] TOPN metrics are histograms that contain overall count and per-bucket count. Overall count can be negative when two profiles merge and some of per-bucket metrics are disacarded. Noticed as an ICE on python PGO build where gcc crashes as: during IPA pass: modref a.c:36:1: ICE: in stream_out_histogram_value, at value-prof.cc:340 36 | } | ^ stream_out_histogram_value(output_block*, histogram_value_t*) gcc/value-prof.cc:340 gcc/ChangeLog: PR gcov-profile/105282 * value-prof.cc (stream_out_histogram_value): Allow negative counts on HIST_TYPE_INDIR_CALL. Should be fixed on gcc-12. (In reply to Martin Liška from comment #4) > (In reply to Sergei Trofimovich from comment #2) > > Proposed the fix as > > https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg283031.html > > Next time, please use our official mailing list: > https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593287.html Sounds good! Proposed identical patch as a gcc-11 backport: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593382.html GCC 11.3 is being released, retargeting bugs to GCC 11.4. The releases/gcc-11 branch has been updated by Martin Liska <marxin@gcc.gnu.org>: https://gcc.gnu.org/g:7b879564ec2bda6b5441fbaf231d70ec6359db01 commit r11-9896-g7b879564ec2bda6b5441fbaf231d70ec6359db01 Author: Sergei Trofimovich <siarheit@google.com> Date: Fri Apr 15 08:35:27 2022 +0100 gcov-profile: Allow negative counts of indirect calls [PR105282] TOPN metrics are histograms that contain overall count and per-bucket count. Overall count can be negative when two profiles merge and some of per-bucket metrics are disacarded. Noticed as an ICE on python PGO build where gcc crashes as: during IPA pass: modref a.c:36:1: ICE: in stream_out_histogram_value, at value-prof.cc:340 36 | } | ^ stream_out_histogram_value(output_block*, histogram_value_t*) gcc/value-prof.c:340 gcc/ChangeLog: PR gcov-profile/105282 * value-prof.c (stream_out_histogram_value): Allow negative counts on HIST_TYPE_INDIR_CALL. (cherry picked from commit 90a29845bfe7d6002e6c2fd49a97820b00fbc4a3) Cherry-picked after 11.3 got released. Closing now. |