From: Andrey Belevantsev Date: Tue, 15 Mar 2016 15:36:44 +0000 (+0300) Subject: re PR target/66660 ([ia64] Speculative load not checked before use, leading to a... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11a6609c191c4feae4b744944fa178b1e763c904;p=gcc.git 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 --- 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);