From: Jeff Law <law@redhat.com>
To: Renlin Li <renlin.li@arm.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH] Improve DOM's optimization of control statements
Date: Fri, 02 Oct 2015 19:30:00 -0000 [thread overview]
Message-ID: <560EDB6C.7010504@redhat.com> (raw)
In-Reply-To: <560E6759.3020806@arm.com>
[-- Attachment #1: Type: text/plain, Size: 787 bytes --]
On 10/02/2015 05:15 AM, Renlin Li wrote:
> Hi Jeff,
>
> Your patch causes an ICE regression.
> The test case is " gcc.c-torture/compile/pr27087.c", I observed it on
> aarch64-none-elf target when compiling the test case with '-Os' flag.
>
> A quick check shows, the cfg has been changed, but the loop information
> is not updated. Thus the information about the number of basic block in
> a loop is not reliable.
>
> Could you please have a look?
As I mentioned, when we collapse a conditional inside a loop, we may
change the # of nodes in a loop which edges are exit edges and possibly
other stuff. So we need to mark loops as needing fixups.
Verified this fixes the aarch64-elf regression and did a bootstrap &
regression test on x86_64-linux-gnu.
Installed on the trunk.
jeff
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1377 bytes --]
commit 992d281b2d1ba53a49198db44fee92a505e16f5d
Author: Jeff Law <law@tor.usersys.redhat.com>
Date: Fri Oct 2 15:22:04 2015 -0400
Re: [PATCH] Improve DOM's optimization of control statements
* tree-ssa-dom.c (optimize_stmt): Note when loop structures need
fixups.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3f7561a..e541df3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-02 Jeff Law <law@redhat.com>
+
+ * tree-ssa-dom.c (optimize_stmt): Note when loop structures need
+ fixups.
+
2015-10-02 Uros Bizjak <ubizjak@gmail.com>
* system.h (ROUND_UP): New macro definition.
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index a8b7038..d940816 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1843,6 +1843,12 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si,
/* Delete threads that start at BB. */
remove_jump_threads_starting_at (bb);
+ /* If BB is in a loop, then removing an outgoing edge from BB
+ may cause BB to move outside the loop, changes in the
+ loop exit edges, etc. So note that loops need fixing. */
+ if (bb_loop_depth (bb) > 0)
+ loops_state_set (LOOPS_NEED_FIXUP);
+
/* Now clean up the control statement at the end of
BB and remove unexecutable edges. */
remove_ctrl_stmt_and_useless_edges (bb, taken_edge->dest);
next prev parent reply other threads:[~2015-10-02 19:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 22:11 Jeff Law
2015-10-02 11:15 ` Renlin Li
2015-10-02 15:15 ` Jeff Law
2015-10-02 16:25 ` Jeff Law
2015-10-02 19:30 ` Jeff Law [this message]
2015-10-05 9:02 ` Richard Biener
2015-10-06 17:41 ` Jeff Law
2015-10-07 21:56 ` Jeff Law
2015-10-07 22:03 ` Andreas Schwab
2015-10-07 22:06 ` Jeff Law
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=560EDB6C.7010504@redhat.com \
--to=law@redhat.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=renlin.li@arm.com \
/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).