]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/66660
authorabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2016 15:36:44 +0000 (15:36 +0000)
committerabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2016 15:36:44 +0000 (15:36 +0000)
        * sel-sched-ir.c (merge_expr): Avoid changing the speculative pattern
        to non-speculative when propagating trap bits.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234218 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/sel-sched-ir.c

index 5cb36dfbef12eb28d38f81027c21959938c769a9..9507853ba42c1bea0e79b7182848ee1ca2df5a12 100644 (file)
@@ -1871,12 +1871,16 @@ merge_expr (expr_t to, expr_t from, insn_t split_point)
   /* Make sure that speculative pattern is propagated into exprs that
      have non-speculative one.  This will provide us with consistent
      speculative bits and speculative patterns inside expr.  */
-  if ((EXPR_SPEC_DONE_DS (from) != 0
-       && EXPR_SPEC_DONE_DS (to) == 0)
-      /* Do likewise for volatile insns, so that we always retain
-        the may_trap_p bit on the resulting expression.  */
-      || (VINSN_MAY_TRAP_P (EXPR_VINSN (from))
-         && !VINSN_MAY_TRAP_P (EXPR_VINSN (to))))
+  if (EXPR_SPEC_DONE_DS (to) == 0
+      && (EXPR_SPEC_DONE_DS (from) != 0
+         /* Do likewise for volatile insns, so that we always retain
+            the may_trap_p bit on the resulting expression.  However,
+            avoid propagating the trapping bit into the instructions
+            already speculated.  This would result in replacing the
+            speculative pattern with the non-speculative one and breaking
+            the speculation support.  */
+         || (!VINSN_MAY_TRAP_P (EXPR_VINSN (to))
+             && VINSN_MAY_TRAP_P (EXPR_VINSN (from)))))
     change_vinsn_in_expr (to, EXPR_VINSN (from));
 
   merge_expr_data (to, from, split_point);