public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/112303] [14 Regression] ICE on valid code at -O3 on x86_64-linux-gnu: verify_flow_info failed since r14-3459-g0c78240fd7d519
Date: Tue, 05 Mar 2024 11:19:24 +0000	[thread overview]
Message-ID: <bug-112303-4-eeK0cuCAsk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112303-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Still reproduceable with
--- gcc/tree-scalar-evolution.cc
+++ gcc/tree-scalar-evolution.cc
@@ -3881,7 +3881,7 @@ final_value_replacement_loop (class loop *loop)

       /* Propagate constants immediately, but leave an unused initialization
         around to avoid invalidating the SCEV cache.  */
-      if (CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt))
+      if (0 && CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI
(rslt))
        replace_uses_by (rslt, def);

       /* Create the replacement statements.  */
The bb with uninitialized count is created by
#7  0x000000000069060b in create_empty_bb (after=<basic_block 0x7fffe9f78e40
(125)>) at ../../gcc/cfghooks.cc:773
#8  0x0000000000e2c995 in gimple_duplicate_bb (bb=<basic_block 0x7fffe9f1b360
(62)>, id=0x7fffffffc610) at ../../gcc/tree-cfg.cc:6513
#9  0x0000000000691158 in duplicate_block (bb=<basic_block 0x7fffe9f1b360
(62)>, e=<edge 0x0>, after=<basic_block 0x7fffe9fca120 (227)>,
id=0x7fffffffc610)
    at ../../gcc/cfghooks.cc:1119
#10 0x00000000006918f5 in copy_bbs (bbs=0x3bfa670, n=3, new_bbs=0x3bce9c0,
edges=0x7fffffffc790, num_edges=2, new_edges=0x7fffffffc780,
base=0x7fffe9f1f7d0, 
    after=<basic_block 0x7fffe9fca120 (227)>, update_dominance=true) at
../../gcc/cfghooks.cc:1384
#11 0x00000000006a19c6 in duplicate_loop_body_to_header_edge
(loop=0x7fffe9f1f7d0, e=<edge 0x7fffe9f4f3c0 (227 -> 62)>, ndupl=2,
wont_exit=0x3ac78f0, 
    orig=<edge 0x7fffe9f189f0 (65 -> 66)>, Python Exception <class
'gdb.error'>: There is no member or method named m_vecpfx.
to_remove=0x39ba7b0, flags=5) at ../../gcc/cfgloopmanip.cc:1403
#12 0x0000000000fc8fd9 in gimple_duplicate_loop_body_to_header_edge
(loop=0x7fffe9f1f7d0, e=<edge 0x7fffe9f47a20 (61 -> 225)>, ndupl=2,
wont_exit=0x3ac78f0, 
    orig=<edge 0x7fffe9f189f0 (65 -> 66)>, Python Exception <class
'gdb.error'>: There is no member or method named m_vecpfx.
to_remove=0x39ba7b0, flags=5) at ../../gcc/tree-ssa-loop-manip.cc:860
#13 0x0000000000fa53f6 in try_unroll_loop_completely (loop=0x7fffe9f1f7d0,
exit=<edge 0x7fffe9f189f0 (65 -> 66)>, niter=<integer_cst 0x7fffea3163d8>,
may_be_zero=false, ul=UL_ALL, 
    maxiter=2, locus=..., allow_peel=true) at
../../gcc/tree-ssa-loop-ivcanon.cc:960

Seems in the above backtrace it is duplicate_block which does the new_bb->count
updates.

It does:
1107      profile_count new_count = e ? e->count ():
profile_count::uninitialized ();
but e is NULL, so here new_count is unitialized, and then
1114      if (bb->count < new_count)
1115        new_count = bb->count;
here
p bb->count.debug ()
2305843009213693950 (estimated locally, freq 144115188075855872.0000)
p new_count.debug ()
uninitialized
but bb->count < new_count is false due to
  bool operator< (const profile_probability &other) const
    {
      return initialized_p () && other.initialized_p () && m_val < other.m_val;
    }

Shouldn't that be if (!(bb->count >= new_count)) or if (bb->count < new_count
|| !new_count.initialized_p ()) ?
Honza?

  parent reply	other threads:[~2024-03-05 11:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 21:52 [Bug tree-optimization/112303] New: ICE on valid code at -O3 on x86_64-linux-gnu: verify_flow_info failed zhendong.su at inf dot ethz.ch
2023-10-30 21:55 ` [Bug tree-optimization/112303] " zhendong.su at inf dot ethz.ch
2023-10-30 21:59 ` [Bug tree-optimization/112303] [14 Regression] " pinskia at gcc dot gnu.org
2023-10-30 22:00 ` pinskia at gcc dot gnu.org
2023-10-31  3:21 ` sjames at gcc dot gnu.org
2023-10-31  5:15 ` [Bug tree-optimization/112303] [14 Regression] ICE on valid code at -O3 on x86_64-linux-gnu: verify_flow_info failed since r14-3459-g0c78240fd7d519 sjames at gcc dot gnu.org
2023-10-31  8:45 ` rguenth at gcc dot gnu.org
2023-10-31 11:08 ` zhendong.su at inf dot ethz.ch
2023-12-05 22:55 ` pinskia at gcc dot gnu.org
2023-12-05 23:02 ` jakub at gcc dot gnu.org
2023-12-06  7:35 ` rguenther at suse dot de
2024-03-05 11:19 ` jakub at gcc dot gnu.org [this message]
2024-03-26 10:36 ` rguenth at gcc dot gnu.org
2024-03-26 10:40 ` jakub at gcc dot gnu.org
2024-03-26 11:45 ` jakub at gcc dot gnu.org
2024-03-27 14:35 ` jakub at gcc dot gnu.org
2024-03-27 17:46 ` hubicka at ucw dot cz
2024-03-28 14:05 ` cvs-commit at gcc dot gnu.org
2024-03-30  3:55 ` cvs-commit at gcc dot gnu.org
2024-04-03 11:59 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-112303-4-eeK0cuCAsk@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).