aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2018-07-16 17:11:57 +0200
committerUros Bizjak <uros@gcc.gnu.org>2018-07-16 17:11:57 +0200
commitf4eafec9bc30855c45cfe86a0b04b88719516e76 (patch)
treefb66d8bc9abfcd970df7650dfbc6f6afea97e03b /gcc/expmed.c
parente2144dde6e6d6c965885121697cbbfd2aa25a9bc (diff)
downloadgcc-f4eafec9bc30855c45cfe86a0b04b88719516e76.zip
gcc-f4eafec9bc30855c45cfe86a0b04b88719516e76.tar.gz
gcc-f4eafec9bc30855c45cfe86a0b04b88719516e76.tar.bz2
re PR middle-end/86511 (Traps are generated for non-trapping compares)
PR target/86511 * expmed.c (emit_store_flag): Do not emit setcc followed by a conditional move when trapping comparison was split to a non-trapping one (and vice versa). From-SVN: r262736
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index b01e194..f114eb4 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -6038,6 +6038,11 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
if (!HAVE_conditional_move)
return 0;
+ /* Do not turn a trapping comparison into a non-trapping one. */
+ if ((code != EQ && code != NE && code != UNEQ && code != LTGT)
+ && flag_trapping_math)
+ return 0;
+
/* Try using a setcc instruction for ORDERED/UNORDERED, followed by a
conditional move. */
tem = emit_store_flag_1 (subtarget, first_code, op0, op1, mode, 0,