From 953e25c44acc2458d854b1442d7775d997aaf187 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 24 Feb 2019 20:23:51 +0100 Subject: re PR rtl-optimization/89445 (_mm512_maskz_loadu_pd "forgets" to use the mask) PR rtl-optimization/89445 * simplify-rtx.c (simplify_ternary_operation): Don't use simplify_merge_mask on operands that may trap. * rtlanal.c (may_trap_p_1): Use FLOAT_MODE_P instead of SCALAR_FLOAT_MODE_P checks. For integral division by zero, if second operand is CONST_VECTOR, check if any element could be zero. Don't expect traps for VEC_{MERGE,SELECT,CONCAT,DUPLICATE} unless their operands can trap. * gcc.target/i386/avx512f-pr89445.c: New test. From-SVN: r269176 --- gcc/simplify-rtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 83580a2..89a46a9 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -6073,8 +6073,10 @@ simplify_ternary_operation (enum rtx_code code, machine_mode mode, if (!side_effects_p (op2)) { - rtx top0 = simplify_merge_mask (op0, op2, 0); - rtx top1 = simplify_merge_mask (op1, op2, 1); + rtx top0 + = may_trap_p (op0) ? NULL_RTX : simplify_merge_mask (op0, op2, 0); + rtx top1 + = may_trap_p (op1) ? NULL_RTX : simplify_merge_mask (op1, op2, 1); if (top0 || top1) return simplify_gen_ternary (code, mode, mode, top0 ? top0 : op0, -- cgit v1.1