public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/103652] New: Producing profile with -O2 -flto and trying to consume it with -O3 -flto leads to ICEs on indirect call profiling
@ 2021-12-10 16:18 hubicka at gcc dot gnu.org
  2021-12-13  9:53 ` [Bug gcov-profile/103652] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-10 16:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103652

            Bug ID: 103652
           Summary: Producing profile with -O2 -flto and trying to consume
                    it with -O3 -flto leads to ICEs on indirect call
                    profiling
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Building clang in the funny way (training with -O2 -flto -fprofile-generate)
and use with -O3 -flto -fprofile-generate I get ICE here:

Program received signal SIGSEGV, Segmentation fault.
compute_value_histograms (lineno_checksum=2372477078, cfg_checksum=4074682759,
values=...) at ../../gcc/profile.c:931
931                   hist->hvalue.counters[j] = act_count[t][j];
(gdb) l
926               gimple_add_histogram_value (cfun, stmt, hist);
927               hist->n_counters = total_size;
928               hist->hvalue.counters = XNEWVEC (gcov_type,
hist->n_counters);
929               for (j = 0; j < hist->n_counters; j++)
930                 if (act_count[t])
931                   hist->hvalue.counters[j] = act_count[t][j];
932                 else
933                   hist->hvalue.counters[j] = 0;
934               act_count[t] += hist->n_counters;
935               sort_hist_values (hist);
(gdb) p hist
$1 = (histogram_value) 0x21e9d40
(gdb) p *hist
$2 = {hvalue = {value = 0x7fffea4b9e10, stmt = 0x7fffea4a4ab0, counters =
0x7ffdf13db010, next = 0x0}, type = HIST_TYPE_INDIR_CALL, n_counters =
1059049550, fun = 0x7fffed96ce40, hdata = {intvl = {int_start = 0, steps = 0}}}
(gdb) p hist->n_counters
$6 = 1059049550

and I also get ICE:

/home/jh/llvm-project/clang/lib/AST/ASTContext.cpp: At top level:
/home/jh/llvm-project/clang/lib/AST/ASTContext.cpp:11856:1: internal compiler
error: in stream_out_histogram_value, at value-prof.c:340


I think it is mismatched profile but I do not know - certainly the streaming
needs more sanity checks here....

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-13 13:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 16:18 [Bug gcov-profile/103652] New: Producing profile with -O2 -flto and trying to consume it with -O3 -flto leads to ICEs on indirect call profiling hubicka at gcc dot gnu.org
2021-12-13  9:53 ` [Bug gcov-profile/103652] " marxin at gcc dot gnu.org
2021-12-13 10:06 ` hubicka at kam dot mff.cuni.cz
2021-12-13 10:38 ` marxin at gcc dot gnu.org
2021-12-13 10:43   ` Jan Hubicka
2021-12-13 10:44 ` hubicka at kam dot mff.cuni.cz
2021-12-13 13:57 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).