summaryrefslogtreecommitdiff
path: root/gcc/sel-sched-ir.c
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2013-02-27 12:56:08 +0400
committerAndrey Belevantsev <abel@gcc.gnu.org>2013-02-27 12:56:08 +0400
commit436a956a80a5b083348ce9c336b59ae04f883f2e (patch)
tree9ce85787bc76ebf33091259846b485916408196d /gcc/sel-sched-ir.c
parent0fcb564b72f58f8d3fa3351fbad33d32b63697ca (diff)
downloadgcc-436a956a80a5b083348ce9c336b59ae04f883f2e.tar.gz
re PR middle-end/45472 ([Middle-end volatile semantics] ICE: in move_op_ascend, at sel-sched.c:6124 with -fselective-scheduling2)
PR middle-end/45472 gcc/ * sel-sched-ir.c (merge_expr): Also change vinsn of merged expr when the may_trap_p bit of the exprs being merged differs. Reorder tests for speculativeness in the logical and operator. testsuite/ * gcc.dg/45472.c: New test. From-SVN: r196308
Diffstat (limited to 'gcc/sel-sched-ir.c')
-rw-r--r--gcc/sel-sched-ir.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 39dc52f66d9..ae17351b595 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -1866,8 +1866,12 @@ 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 (to) == 0
- && EXPR_SPEC_DONE_DS (from) != 0)
+ 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))))
change_vinsn_in_expr (to, EXPR_VINSN (from));
merge_expr_data (to, from, split_point);