On 02/10/2016 02:50 PM, Richard Biener wrote:
On Wed, 10 Feb 2016, Bernd Schmidt wrote:

On 02/10/2016 02:35 PM, Richard Biener wrote:

Index: gcc/ifcvt.c
===================================================================
--- gcc/ifcvt.c (revision 233262)
+++ gcc/ifcvt.c (working copy)
@@ -1274,7 +1274,8 @@ noce_try_store_flag_constants (struct no
         && CONST_INT_P (XEXP (a, 1))
         && CONST_INT_P (XEXP (b, 1))
         && rtx_equal_p (XEXP (a, 0), XEXP (b, 0))
-      && noce_operand_ok (XEXP (a, 0))
+      && (REG_P (XEXP (a, 0))
+         || ! reg_mentioned_p (if_info->x, XEXP (a, 0)))

I guess that would also work. Could maybe use a brief comment.

Ok.  I'm testing that.  I wonder if we need to use reg_overlap_mentioned_p
here (hard-reg pairs?) or if reg_mentioned_p is safe.

Let's go with reg_overlap_mentioned_p. I kind of forgot about that once I thought of possible issues with emitting a move :-(


Bernd

Reply via email to