diff mbox

[PR,rtl-optimization/79286] Drop may_trap_p exception to testing dominance in update_equiv_regs

Message ID 76f10056-5493-871a-b3ee-652de57e3171@redhat.com
State New
Headers show

Commit Message

Jeff Law Feb. 24, 2017, 3:41 p.m. UTC
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
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 mbox

Patch

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);