public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH][ PR rtl-optimization/79286] Drop may_trap_p exception to testing dominance in update_equiv_regs
Date: Fri, 24 Feb 2017 15:48:00 -0000	[thread overview]
Message-ID: <76f10056-5493-871a-b3ee-652de57e3171@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]


Per a discussion with Alan...

update_equiv_regs now tests that the insn which creates an equivalence 
dominates its uses.  With one exception, if may_trap_p returns false, we 
don't require dominance.

may_trap_p unfortunately returns false for PIC references in cases where 
they can clearly trap (as seen with the reduced testcase for this BZ in 
PIC mode).  I'm not really up for pulling on that thread right now.

Instead we just drop the may_trap_p exception and always verify 
dominance.  This fixes 79286 when generating PIC (and thus ought to fix 
the i686 darwin issues.

Bootstrapped and regression tested on i686-pc-linux-gnu.  Also hand 
verified the reduced testcase works with PIC.

Installing on the trunk.

Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1162 bytes --]

commit 3a05b44836c9576b33101ed7c381ad21aa5f1581
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Feb 24 15:36:10 2017 +0000

    	PR rtl-optimizatoin/79286
    	* ira.c (update_equiv_regs): Drop may_trap_p exception to
    	dominance test.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245714 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22964c8..1239c4a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-24  Jeff Law  <law@redhat.com>
+
+	PR rtl-optimizatoin/79286
+	* ira.c (update_equiv_regs): Drop may_trap_p exception to
+	dominance test.
+
 2017-02-24  Richard Biener  <rguenther@suse.de>
 
 	PR tree-optimization/79389
diff --git a/gcc/ira.c b/gcc/ira.c
index 6fb8aaf..b41c480 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3551,8 +3551,7 @@ update_equiv_regs (void)
 	  if (DF_REG_DEF_COUNT (regno) == 1
 	      && note
 	      && !rtx_varies_p (XEXP (note, 0), 0)
-	      && (!may_trap_p (XEXP (note, 0))
-		  || def_dominates_uses (regno)))
+	      && def_dominates_uses (regno))
 	    {
 	      rtx note_value = XEXP (note, 0);
 	      remove_note (insn, note);

             reply	other threads:[~2017-02-24 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 15:48 Jeff Law [this message]
2017-04-23 18:33 Bernd Edlinger
2017-04-28 17:17 ` Jeff Law
2017-04-28 18:05   ` Bernd Edlinger
2017-04-28 19:01     ` Jeff Law
2017-04-28 20:23       ` Bernd Edlinger
2017-04-28 20:27         ` Bernd Edlinger
2017-04-29  9:27       ` Bernd Edlinger
2017-06-23  4:35         ` 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=76f10056-5493-871a-b3ee-652de57e3171@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@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).