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/96931] [11 Regression] ICE in add_phi_arg, at tree-phinodes.c:359
Date: Fri, 04 Sep 2020 08:26:10 +0000	[thread overview]
Message-ID: <bug-96931-4-Et0DM8Zdf6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96931-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index b1d6e63559c..af71c269f4b 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1960,7 +1960,8 @@ initialize_root_vars_lm (class loop *loop, dref root,
bool written,

   init = force_gimple_operand (init, &stmts, written, NULL_TREE);
   if (stmts)
-    gsi_insert_seq_on_edge_immediate (entry, stmts);
+    if (gsi_insert_seq_on_edge_immediate (entry, stmts))
+      entry = loop_preheader_edge (loop);

   if (written)
     {


guess even with simple preheaders passes need to not assume inserting
on the entry edge will not split it (the call in the preheader ends the BB
because we've had returns_twice functions).

Now the ie() call was removed and so was the abnormal edge from p3() so
likely gimple_call_ctrl_altering_p should have been cleared from it which
would be a missed optimization.  Thus an alternative fix is there.

  parent reply	other threads:[~2020-09-04  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  6:50 [Bug tree-optimization/96931] New: " asolokha at gmx dot com
2020-09-04  7:49 ` [Bug tree-optimization/96931] " rguenth at gcc dot gnu.org
2020-09-04  8:26 ` rguenth at gcc dot gnu.org [this message]
2020-09-04  8:34 ` rguenth at gcc dot gnu.org
2020-09-04 10:23 ` cvs-commit at gcc dot gnu.org
2020-09-04 10:23 ` 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-96931-4-Et0DM8Zdf6@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).