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
This commit is contained in:
Jakub Jelinek 2018-01-06 08:47:32 +01:00 committed by Jakub Jelinek
parent dba9c1fd27
commit 8fec4d222f
4 changed files with 32 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2018-01-06 Jakub Jelinek <jakub@redhat.com>
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.

View File

@ -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 <typename T>
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;

View File

@ -1,3 +1,8 @@
2018-01-06 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/83682
* gcc.target/i386/pr83682.c: New test.
2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/78534

View File

@ -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));
}