aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-11-13 10:45:50 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-11-13 10:45:50 +0100
commit6bddea17a0464f674bf71d019af4c50c44ed6ed6 (patch)
tree296ffe78d4a9f93adf2af4b393f4f56ee39e92c2 /gcc/simplify-rtx.c
parent9384a5afd6eac11ce7419869bbd2663fefdf918c (diff)
downloadgcc-6bddea17a0464f674bf71d019af4c50c44ed6ed6.zip
gcc-6bddea17a0464f674bf71d019af4c50c44ed6ed6.tar.gz
gcc-6bddea17a0464f674bf71d019af4c50c44ed6ed6.tar.bz2
re PR rtl-optimization/87918 (ICE in simplify_binary_operation, at simplify-rtx.c:2153 since r264688)
PR rtl-optimization/87918 * simplify-rtx.c (simplify_merge_mask): For COMPARISON_P, use simplify_gen_relational rather than simplify_gen_binary. * gcc.target/i386/pr87918.c: New test. From-SVN: r266062
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 0d53135..db8af2f 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -5647,9 +5647,19 @@ simplify_merge_mask (rtx x, rtx mask, int op)
rtx top0 = simplify_merge_mask (XEXP (x, 0), mask, op);
rtx top1 = simplify_merge_mask (XEXP (x, 1), mask, op);
if (top0 || top1)
- return simplify_gen_binary (GET_CODE (x), GET_MODE (x),
- top0 ? top0 : XEXP (x, 0),
- top1 ? top1 : XEXP (x, 1));
+ {
+ if (COMPARISON_P (x))
+ return simplify_gen_relational (GET_CODE (x), GET_MODE (x),
+ GET_MODE (XEXP (x, 0)) != VOIDmode
+ ? GET_MODE (XEXP (x, 0))
+ : GET_MODE (XEXP (x, 1)),
+ top0 ? top0 : XEXP (x, 0),
+ top1 ? top1 : XEXP (x, 1));
+ else
+ return simplify_gen_binary (GET_CODE (x), GET_MODE (x),
+ top0 ? top0 : XEXP (x, 0),
+ top1 ? top1 : XEXP (x, 1));
+ }
}
if (GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY
&& VECTOR_MODE_P (GET_MODE (XEXP (x, 0)))