diff --git a/gcc/testsuite/gcc.dg/pr107686.c b/gcc/testsuite/gcc.dg/pr107686.c new file mode 100644 index 0000000000000000000000000000000000000000..2378103c5553d645ba7833f09bcefe9d7417b20a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr107686.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { dfp && longlong64 } } } */ +/* { dg-options "-O" } */ +/* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */ + +typedef _Decimal64 __attribute__((__vector_size__ (64))) D; +typedef __INT32_TYPE__ __attribute__((__vector_size__ (32))) U; +typedef __INT64_TYPE__ __attribute__((__vector_size__ (64))) V; + +U u; +D d; + +void +foo (void) +{ + d = d < (D) __builtin_convertvector (u, V); +} diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index 7c7942600ef2d6b9fd95a871228c2f543c401702..429f77f199c44b1325dce7736d0368698ecfdc7e 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.cc @@ -3162,7 +3162,11 @@ optimize_vector_load (gimple_stmt_iterator *gsi) && (def == lhs || (known_eq (bit_field_size (use_rhs), def_eltsize) && constant_multiple_p (bit_field_offset (use_rhs), - def_eltsize)))) + def_eltsize) + /* We can simulate the VEC_UNPACK_{HI,LO}_EXPR + via a NOP_EXPR only for integral types. + ??? Support VEC_UNPACK_FLOAT_{HI,LO}_EXPR. */ + && INTEGRAL_TYPE_P (TREE_TYPE (use_rhs))))) { bf_stmts.safe_push (use_stmt); continue;