summaryrefslogtreecommitdiff
path: root/gcc/sel-sched-ir.c
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@gcc.gnu.org>2016-03-15 18:36:44 +0300
committerAndrey Belevantsev <abel@gcc.gnu.org>2016-03-15 18:36:44 +0300
commit11a6609c191c4feae4b744944fa178b1e763c904 (patch)
tree95dd1572eea3cd8d92b358b3d6cc0289d71fb12d /gcc/sel-sched-ir.c
parent81fa2944ecfd7f4e8855fa51e7017a40c5f27721 (diff)
re PR target/66660 ([ia64] Speculative load not checked before use, leading to a NaT Consumption Vector interruption)
PR target/66660 * sel-sched-ir.c (merge_expr): Avoid changing the speculative pattern to non-speculative when propagating trap bits. From-SVN: r234218
Diffstat (limited to 'gcc/sel-sched-ir.c')
-rw-r--r--gcc/sel-sched-ir.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 5cb36dfbef1..9507853ba42 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -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);