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.
*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;
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;
+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
--- /dev/null
+/* 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));
+}