public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/111950] [14 Regression] ICE in compute_live_loop_exits, at tree-ssa-loop-manip.cc:250 since r14-4786-gd118738e71c
Date: Fri, 27 Oct 2023 14:14:03 +0000	[thread overview]
Message-ID: <bug-111950-4-CQCVCgkdys@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111950-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code,
                   |                            |wrong-code

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
For the epilog LC-SSA we lack the correct SSA name for the skip edge:


<bb 38> [local count: 16140304]:
# prephitmp_78 = PHI <prephitmp_61(35), prephitmp_64(32)>
# c_I_lsm.18_79 = PHI <c_I_lsm.18_60(35), c_I_lsm.18_60(32)>
# iftmp.0_80 = PHI <iftmp.0_59(35), iftmp.0_66(32)>

see how c_I_lsm.18_60 is used for both args but the name is defined in
the epilog only.

Though it looks like the original reduction variable isn't computed
at all for the loop which means the reduction vectorization is wrong.

if-conversion turns

<bb 11> [local count: 146730041]:
# d.12_13 = PHI <d.12_5(18), _37(15)>
_1 = a.3_23 >> b.2_22;
if (_1 != 0)
  goto <bb 13>; [50.00%]
else
  goto <bb 14>; [50.00%]

<bb 14> [local count: 146730041]:

# iftmp.0_9 = PHI <1(13), iftmp.0_39(11)>
# c_I_lsm.18_38 = PHI <1(13), a.3_23(11)>
# prephitmp_43 = PHI <1(13), a.3_23(11)>
_37 = d.12_13 + 1;
if (_37 != 0)
  goto <bb 15>; [89.00%]
else
  goto <bb 19>; [11.00%]

into

<bb 11> [local count: 146730041]:
# d.12_13 = PHI <_37(15), d.12_5(26)>
iftmp.0_9 = _32 ? 1 : iftmp.0_39;
c_I_lsm.18_38 = _32 ? 1 : a.3_23;
_37 = d.12_13 + 1;
if (_37 != 0)
  goto <bb 15>; [89.00%]
else
  goto <bb 19>; [11.00%]

turning c_I_lsm.18_38 into a fully invariant reduction def which likely isn't
supported - we had bugs here in the past with not relevant but live stmts.
But if-conversion also performs the (now valid) hoisting, this is maybe
why it was triggered by that rev.

  parent reply	other threads:[~2023-10-27 14:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  7:15 [Bug tree-optimization/111950] New: " shaohua.li at inf dot ethz.ch
2023-10-24  7:50 ` [Bug tree-optimization/111950] [14 Regression] " rguenth at gcc dot gnu.org
2023-10-27 14:14 ` rguenth at gcc dot gnu.org [this message]
2023-10-27 14:29 ` tnfchris at gcc dot gnu.org
2023-10-27 16:02 ` tnfchris at gcc dot gnu.org
2023-11-03 12:02 ` rguenth at gcc dot gnu.org
2023-11-03 13:27 ` rguenth at gcc dot gnu.org
2023-11-03 14:14 ` rguenth at gcc dot gnu.org
2023-11-03 14:57 ` rguenth at gcc dot gnu.org
2023-11-03 15:58 ` tnfchris at gcc dot gnu.org
2023-11-06  9:51 ` rguenth at gcc dot gnu.org
2023-11-06 13:16 ` cvs-commit at gcc dot gnu.org
2023-11-06 13:18 ` rguenth 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-111950-4-CQCVCgkdys@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).