public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken
@ 2023-07-31 12:20 prathamesh3492 at gcc dot gnu.org
  2023-08-01  8:53 ` [Bug middle-end/110857] " hubicka at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2023-07-31 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110857
           Summary: aarch64-linux-gnu profiledbootstrap broken
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prathamesh3492 at gcc dot gnu.org
  Target Milestone: ---

Bootstrapping gcc with profiledboostrap results in following failure:

during GIMPLE pass: ivcanon
../../gcc/gcc/cfgrtl.cc: In function ‘bool could_fall_through(basic_block,
basic_block)’:
../../gcc/gcc/cfgrtl.cc:670:1: internal compiler error: in operator>, at
profile-count.h:995
  670 | could_fall_through (basic_block src, basic_block target)
      | ^~~~~~~~~~~~~~~~~~
0xc6c89f profile_count::operator>(profile_count const&) const
        ../../gcc/gcc/profile-count.h:995
0xc6c89f profile_count::operator>(profile_count const&) const
        ../../gcc/gcc/profile-count.h:987
0xc6c89f update_loop_exit_probability_scale_dom_bbs(loop*, edge_def*,
profile_count)
        ../../gcc/gcc/cfgloopmanip.cc:641
0xc6cb2b scale_loop_profile(loop*, profile_probability, long)
        ../../gcc/gcc/cfgloopmanip.cc:776
0x1338a5f try_unroll_loop_completely
        ../../gcc/gcc/tree-ssa-loop-ivcanon.cc:927
0x1338a5f canonicalize_loop_induction_variables
        ../../gcc/gcc/tree-ssa-loop-ivcanon.cc:1274
0x13396cf canonicalize_induction_variables()
        ../../gcc/gcc/tree-ssa-loop-ivcanon.cc:1317
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

This seems most likely caused due to:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=88618fa0211d77d91b70f7af9b02e08a34b57912

Thanks,
Prathamesh

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
@ 2023-08-01  8:53 ` hubicka at gcc dot gnu.org
  2023-08-02 12:20 ` sirl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-08-01  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The sanity check fires since profile count involved are not compatible that
should never happen within a single function.  Would it be possible to dump
them? From debugger one should be able to call 
 p this->debug();
 p other.debug ();
from stage1 compiler that is build with -O0.

It is quite possible that this bug is carried for a while through the
optimization pipeline. It would be also useful to have
-fdump-tree-all-blocks-details and -fdump-rtl-all-blocks-details dumps.

Honza

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
  2023-08-01  8:53 ` [Bug middle-end/110857] " hubicka at gcc dot gnu.org
@ 2023-08-02 12:20 ` sirl at gcc dot gnu.org
  2023-08-03 20:42 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sirl at gcc dot gnu.org @ 2023-08-02 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

Franz Sirl <sirl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sirl at gcc dot gnu.org

--- Comment #2 from Franz Sirl <sirl at gcc dot gnu.org> ---
x86_64-linux profiledbootstrap shows a similar symptom (trunk@r14-2929):

during GIMPLE pass: ivcanon
../../gcc/cfgrtl.cc: In function 'bool can_fallthru(basic_block, basic_block)':
../../gcc/cfgrtl.cc:638:1: internal compiler error: in operator>, at
profile-count.h:995
  638 | can_fallthru (basic_block src, basic_block target)
      | ^~~~~~~~~~~~
0xa8fb07 profile_count::operator>(profile_count const&) const
        ../../gcc/profile-count.h:995
0xa93642 update_loop_exit_probability_scale_dom_bbs(loop*, edge_def*,
profile_count)
        ../../gcc/cfgloopmanip.cc:614
0xa9449f scale_loop_profile(loop*, profile_probability, long)
        ../../gcc/cfgloopmanip.cc:749
0x10dc9ee try_unroll_loop_completely
        ../../gcc/tree-ssa-loop-ivcanon.cc:927
0x10dc9ee canonicalize_loop_induction_variables
        ../../gcc/tree-ssa-loop-ivcanon.cc:1274
0x10dd9c4 canonicalize_induction_variables()
        ../../gcc/tree-ssa-loop-ivcanon.cc:1317

I'll see if I can find time do the requested debugging later.

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
  2023-08-01  8:53 ` [Bug middle-end/110857] " hubicka at gcc dot gnu.org
  2023-08-02 12:20 ` sirl at gcc dot gnu.org
@ 2023-08-03 20:42 ` cvs-commit at gcc dot gnu.org
  2023-08-04 10:12 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-03 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:93236ad9e8fa9208e754e8806dc369e1a79dbdf7

commit r14-2966-g93236ad9e8fa9208e754e8806dc369e1a79dbdf7
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Aug 3 22:42:27 2023 +0200

    Fix profiledbootstrap

    Profiledbootstrap fails with ICE in
update_loop_exit_probability_scale_dom_bbs
    called from loop unroling.
    The reason is that under relatively rare situations, we may run into case
where
    loop has multiple exits and all are considered as likely but then we scale
down
    the profile and one of the exits becomes unlikely.

    We pass around unadjusted_exit_count to scale exit probability correctly. 
In this
    case we may end up using uninitialized value and profile-count type
intentionally
    bombs on that.

    gcc/ChangeLog:

            PR bootstrap/110857
            * cfgloopmanip.cc (scale_loop_profile): (Un)initialize
            unadjusted_exit_count.

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-08-03 20:42 ` cvs-commit at gcc dot gnu.org
@ 2023-08-04 10:12 ` hubicka at gcc dot gnu.org
  2023-08-04 10:25 ` prathamesh3492 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-08-04 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I hope the fix for x86_64 also cures arm profiledbootstrap. From backtrace it
is the same bug.

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-04 10:12 ` hubicka at gcc dot gnu.org
@ 2023-08-04 10:25 ` prathamesh3492 at gcc dot gnu.org
  2023-08-04 18:05 ` prathamesh3492 at gcc dot gnu.org
  2023-08-06 20:22 ` hubicka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2023-08-04 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
Hi Honza,
Sorry for late response, and thanks for the fix! I am currently running
profiledbootstrap on aarch64 with your fix, and will let you know the results
after it completes.

Thanks,
Prathamesh

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-04 10:25 ` prathamesh3492 at gcc dot gnu.org
@ 2023-08-04 18:05 ` prathamesh3492 at gcc dot gnu.org
  2023-08-06 20:22 ` hubicka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: prathamesh3492 at gcc dot gnu.org @ 2023-08-04 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from prathamesh3492 at gcc dot gnu.org ---
profiledbootstrap now works on aarch64-linux-gnu, thanks!

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

* [Bug middle-end/110857] aarch64-linux-gnu profiledbootstrap broken
  2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-04 18:05 ` prathamesh3492 at gcc dot gnu.org
@ 2023-08-06 20:22 ` hubicka at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-08-06 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-08-06 20:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 12:20 [Bug middle-end/110857] New: aarch64-linux-gnu profiledbootstrap broken prathamesh3492 at gcc dot gnu.org
2023-08-01  8:53 ` [Bug middle-end/110857] " hubicka at gcc dot gnu.org
2023-08-02 12:20 ` sirl at gcc dot gnu.org
2023-08-03 20:42 ` cvs-commit at gcc dot gnu.org
2023-08-04 10:12 ` hubicka at gcc dot gnu.org
2023-08-04 10:25 ` prathamesh3492 at gcc dot gnu.org
2023-08-04 18:05 ` prathamesh3492 at gcc dot gnu.org
2023-08-06 20:22 ` hubicka 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).