public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-5702] tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts_at_dest): Do not allow __builtin_con
Date: Thu,  3 Dec 2020 09:51:04 +0000 (GMT)	[thread overview]
Message-ID: <20201203095104.D9139396EC67@sourceware.org> (raw)

https://gcc.gnu.org/g:614aff0adf8fba5d843ec894603160151c20f0aa

commit r11-5702-g614aff0adf8fba5d843ec894603160151c20f0aa
Author: Ilya Leoshkevich <iii@linux.ibm.com>
Date:   Thu Dec 3 01:38:47 2020 +0100

    tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts_at_dest): Do not allow __builtin_constant_p.
    
    This is the same as commit 70a62009181f ("tree-ssa-threadbackward.c
    (profitable_jump_thread_path): Do not allow __builtin_constant_p."), but
    for the old forward threader.
    
    gcc/ChangeLog:
    
    2020-12-03  Ilya Leoshkevich  <iii@linux.ibm.com>
    
            * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts_at_dest):
            Do not allow __builtin_constant_p on a threading path.

Diff:
---
 gcc/tree-ssa-threadedge.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index f43d5812270..32d63a95af4 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -265,6 +265,12 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
 	  && gimple_call_internal_unique_p (stmt))
 	return NULL;
 
+      /* We cannot thread through __builtin_constant_p, because an
+	 expression that is constant on two threading paths may become
+	 non-constant (i.e.: phi) when they merge.  */
+      if (gimple_call_builtin_p (stmt, BUILT_IN_CONSTANT_P))
+	return NULL;
+
       /* If duplicating this block is going to cause too much code
 	 expansion, then do not thread through this block.  */
       stmt_count++;


                 reply	other threads:[~2020-12-03  9:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20201203095104.D9139396EC67@sourceware.org \
    --to=iii@gcc.gnu.org \
    --cc=gcc-cvs@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).