[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Sergei Trofimovich :

https://gcc.gnu.org/g:90a29845bfe7d6002e6c2fd49a97820b00fbc4a3

commit r12-8199-g90a29845bfe7d6002e6c2fd49a97820b00fbc4a3
Author: Sergei Trofimovich 
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.

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

--- Comment #4 from Martin Liška  ---
(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

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.3
   Keywords||ice-on-valid-code

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-16 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

--- Comment #3 from Sergei Trofimovich  ---
Created attachment 52819
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52819=edit
0001-gcov-profile-Allow-negative-counts-of-indirect-calls.patch

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-15 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

--- Comment #2 from Sergei Trofimovich  ---
Proposed the fix as
https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg283031.html

[Bug gcov-profile/105282] [11/12 Regression] V_INDIR overflow causes ICE on -O0 -flto in stream_out_histogram_value, at value-prof.cc:340

2022-04-15 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105282

--- Comment #1 from Sergei Trofimovich  ---
Relevant bit of counters dump for completeness (after merge):

$ gcov-dump -l a.gcda
...
a.gcda:01a9: 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