public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/111111] New: omnetpp: ICEs with dump flags, PGO and LTO
@ 2023-08-23  6:29 christophm30 at gmail dot com
  2023-08-23  6:34 ` [Bug middle-end/111111] " pinskia at gcc dot gnu.org
  2024-05-03 20:48 ` cmuellner at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: christophm30 at gmail dot com @ 2023-08-23  6:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111111
           Summary: omnetpp: ICEs with dump flags, PGO and LTO
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christophm30 at gmail dot com
  Target Milestone: ---

I ran into an ICE that was introduced by d6c1d7c400 (Jul 9).
The ICEs shows up when compiling 520.omnetpp_r with PGO for RISC-V rv64gc with
"-ggdb -fdump-tree-all-details -fdump-rtl-all-all -save-temps -dp -dA
-fverbose-asm -fprofile-use -Ofast -funroll-loops".
The relevant flags that trigger the ICEs are -fdump-tree-all-details,
-fdump-rtl-all-all, or -dA.
If non of these flags are present, then everything compiles fine.

The ICE looks like this:

during GIMPLE pass: tracer
dump file: ./omnetpp_r.ltrans9.ltrans.194t.tracer
model/MACRelayUnitBase.cc: In member function 'removeAgedEntriesFromTable':
model/MACRelayUnitBase.cc:142:6: internal compiler error: Segmentation fault
  142 | void MACRelayUnitBase::removeAgedEntriesFromTable()
      |      ^
0xeec4bf crash_signal
        /home/cm/src/gcc/riscv-test/gcc/toplev.cc:314
0x1a6e80f dump_bb_info(_IO_FILE*, basic_block_def*, int, dump_flag, bool, bool)
        /home/cm/src/gcc/riscv-test/gcc/cfg.cc:818
0x1a6ec52 brief_dump_cfg(_IO_FILE*, dump_flag)
        /home/cm/src/gcc/riscv-test/gcc/cfg.cc:900
0xeef99c execute
        /home/cm/src/gcc/riscv-test/gcc/tracer.cc:446
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.

Bisecting shows that the following change introduces the issue:

commit d6c1d7c4009bfe759719675ce3bc03ca503b9bf4
Date:   Sun Jul 9 15:14:54 2023 +0200

    Improve dumping of profile_count

    Dumps of profile_counts are quite hard to interpret since they are 64bit
fixed point
    values.  In many cases one looks at a single function and it is better to
think of
    basic block frequency, that is how many times it is executed each
invocatoin. This
    patch makes CFG dumps to also print this info.

When removing/reverting this change (and adding all commits of upstream/master
on top),
then a second ICE shows up: 

during RTL pass: expand
dump file: ./omnetpp_r.ltrans0.ltrans.258r.expand
simulator/cdefaultlist.cc: In member function 'construct':
simulator/cdefaultlist.cc:65:1: internal compiler error: in to_gcov_type, at
profile-count.h:837
   65 | }
      | ^
0x861170 profile_count::to_gcov_type() const
        /home/cm/src/gcc/riscv-test/gcc/profile-count.h:837
0x861673 profile_count::to_gcov_type() const
        /home/cm/src/gcc/riscv-test/gcc/hash-set.h:125
0x861673 dump_prediction
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:793
0xe69dc0 combine_predictions_for_insn
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:1039
0xe69dc0 guess_outgoing_edge_probabilities(basic_block_def*)
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:2356
0x1c6b26f compute_outgoing_frequencies
        /home/cm/src/gcc/riscv-test/gcc/cfgbuild.cc:692
0x1c6b26f find_many_sub_basic_blocks(simple_bitmap_def*)
        /home/cm/src/gcc/riscv-test/gcc/cfgbuild.cc:792
0xa5a60b execute
        /home/cm/src/gcc/riscv-test/gcc/cfgexpand.cc:6933
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.

Bisecting shows that the following change introduces the issue:

commit c69d9d2afd6ec4be37d0bfc26e0b2446df28a231
Date:   Thu Jul 27 15:57:54 2023 +0200

    Fix profile_count::apply_probability

    profile_count::apply_probability misses check for uninitialized probability
which leads
    to completely random results on applying uninitialized probability to
initialized scale.
    This can make difference when i.e. inlining -fno-guess-branch-probability
function
    to -fguess-branch-probability one.

However, this is not 100% accurate, since there is yet another ICE,
which interferes in this context (and thus has tainted the bisect process):

during RTL pass: expand
dump file: ./omnetpp_r.ltrans0.ltrans.258r.expand
simulator/cdisplaystring.cc: In member function 'insertTag':
simulator/cdisplaystring.cc:276:1: internal compiler error: in to_gcov_type, at
profile-count.h:831
  276 | }
      | ^
0x7faa34 profile_count::to_gcov_type() const
        /home/cm/src/gcc/riscv-test/gcc/profile-count.h:831
0x7faf37 profile_count::to_gcov_type() const
        /home/cm/src/gcc/riscv-test/gcc/hash-set.h:125
0x7faf37 dump_prediction
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:797
0xdfafe0 combine_predictions_for_insn
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:1039
0xdfafe0 guess_outgoing_edge_probabilities(basic_block_def*)
        /home/cm/src/gcc/riscv-test/gcc/predict.cc:2356
0x19bc4af compute_outgoing_frequencies
        /home/cm/src/gcc/riscv-test/gcc/cfgbuild.cc:692
0x19bc4af find_many_sub_basic_blocks(simple_bitmap_def*)
        /home/cm/src/gcc/riscv-test/gcc/cfgbuild.cc:792
0x9f0e0b execute
        /home/cm/src/gcc/riscv-test/gcc/cfgexpand.cc:6933
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.

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

* [Bug middle-end/111111] omnetpp: ICEs with dump flags, PGO and LTO
  2023-08-23  6:29 [Bug debug/111111] New: omnetpp: ICEs with dump flags, PGO and LTO christophm30 at gmail dot com
@ 2023-08-23  6:34 ` pinskia at gcc dot gnu.org
  2024-05-03 20:48 ` cmuellner at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-23  6:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-23

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We are going to need a testcase. I suspect you could reduce one even on x86_64.

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

* [Bug middle-end/111111] omnetpp: ICEs with dump flags, PGO and LTO
  2023-08-23  6:29 [Bug debug/111111] New: omnetpp: ICEs with dump flags, PGO and LTO christophm30 at gmail dot com
  2023-08-23  6:34 ` [Bug middle-end/111111] " pinskia at gcc dot gnu.org
@ 2024-05-03 20:48 ` cmuellner at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cmuellner at gcc dot gnu.org @ 2024-05-03 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

Christoph Müllner <cmuellner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Christoph Müllner <cmuellner at gcc dot gnu.org> ---
This can't be reproduced anymore (retested with master and releases/gcc-14).

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

end of thread, other threads:[~2024-05-03 20:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23  6:29 [Bug debug/111111] New: omnetpp: ICEs with dump flags, PGO and LTO christophm30 at gmail dot com
2023-08-23  6:34 ` [Bug middle-end/111111] " pinskia at gcc dot gnu.org
2024-05-03 20:48 ` cmuellner 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).