From: Jakub Jelinek Date: Tue, 13 Nov 2018 09:45:50 +0000 (+0100) Subject: re PR rtl-optimization/87918 (ICE in simplify_binary_operation, at simplify-rtx.c... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6bddea17a0464f674bf71d019af4c50c44ed6ed6;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29a216cd42d..14a310ef99f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-13 Jakub Jelinek + + PR rtl-optimization/87918 + * simplify-rtx.c (simplify_merge_mask): For COMPARISON_P, use + simplify_gen_relational rather than simplify_gen_binary. + 2018-11-13 Richard Biener * tree-ssanames.h (set_range_info): Use value_range_base. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 0d53135f1ff..db8af2f7692 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))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e7d4ad7143c..1427960e534 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-13 Jakub Jelinek + + PR rtl-optimization/87918 + * gcc.target/i386/pr87918.c: New test. + 2018-11-13 Alan Modra * gcc.target/powerpc/rotmask.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr87918.c b/gcc/testsuite/gcc.target/i386/pr87918.c new file mode 100644 index 00000000000..dd62910a539 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87918.c @@ -0,0 +1,14 @@ +/* PR rtl-optimization/87918 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +#include + +__m128 b, c, d; + +void +foo (float f) +{ + c = _mm_set_ss (f); + d = _mm_cmple_ss (c, b); +}