From: Jakub Jelinek Date: Sat, 6 Jan 2018 07:47:32 +0000 (+0100) Subject: re PR rtl-optimization/83682 (ICE in simplify_subreg, at simplify-rtx.c:6296) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8fec4d222f0a35925bfdc4641612120b06d51c59;p=gcc.git re PR rtl-optimization/83682 (ICE in simplify_subreg, at simplify-rtx.c:6296) PR rtl-optimization/83682 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE if it has non-VECTOR_MODE element mode. (vec_duplicate_p): Likewise. * gcc.target/i386/pr83682.c: New test. From-SVN: r256308 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51f92bcf0b0..283f792dcf7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-01-06 Jakub Jelinek + PR rtl-optimization/83682 + * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE + if it has non-VECTOR_MODE element mode. + (vec_duplicate_p): Likewise. + PR middle-end/83694 * cfgexpand.c (expand_debug_expr): Punt if mode1 is VOIDmode and bitsize might be greater than MAX_BITSIZE_MODE_ANY_INT. diff --git a/gcc/rtl.h b/gcc/rtl.h index 224dc966332..71a81a211f1 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2969,7 +2969,9 @@ const_vec_duplicate_p (T x, T *elt) *elt = CONST_VECTOR_ENCODED_ELT (x, 0); return true; } - if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE) + if (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE + && !VECTOR_MODE_P (GET_MODE (XEXP (XEXP (x, 0), 0)))) { *elt = XEXP (XEXP (x, 0), 0); return true; @@ -2984,7 +2986,8 @@ template inline bool vec_duplicate_p (T x, T *elt) { - if (GET_CODE (x) == VEC_DUPLICATE) + if (GET_CODE (x) == VEC_DUPLICATE + && !VECTOR_MODE_P (GET_MODE (XEXP (x, 0)))) { *elt = XEXP (x, 0); return true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d3603a34f9..7ebe12992e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-06 Jakub Jelinek + + PR rtl-optimization/83682 + * gcc.target/i386/pr83682.c: New test. + 2018-01-05 Janne Blomqvist PR fortran/78534 diff --git a/gcc/testsuite/gcc.target/i386/pr83682.c b/gcc/testsuite/gcc.target/i386/pr83682.c new file mode 100644 index 00000000000..cbb61ff3210 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr83682.c @@ -0,0 +1,17 @@ +/* PR rtl-optimization/83682 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +typedef float V __attribute__((__vector_size__(16))); +typedef double W __attribute__((__vector_size__(16))); +V b; +W c; + +void +foo (void *p) +{ + V e = __builtin_ia32_cvtsd2ss (b, c); + V g = e; + float f = g[0]; + __builtin_memcpy (p, &f, sizeof (f)); +}