https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129248

--- Comment #1 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
Confirmed, also at -O2 -msse4.1.  Started with r16-5561.

slp2 leaves

  _1 = BIT_FIELD_REF <a_5(D), 8, 0>;   // unsigned char
  _2 = (int) _1;
  _3 = BIT_FIELD_REF <a_5(D), 8, 8>;   // signed char
  _4 = (int) _3;
  _10 = {_2, _4};

and forwprop4 (simplify_vector_constructor) turns it into

  _11 = BIT_FIELD_REF <a_5(D), 16, 0>; // vector(2) unsigned char
  _10 = (vector(2) int) _11;

so lane 1 is zero-extended instead of sign-extended.

r16-5561 relaxed the element check to tree_nop_conversion_p, which
accepts the signed char extract from the unsigned char vector.
orig_elem_type[] (PR123117/PR123731) only records the type of the first
extracted element, so the signedness mismatch in lane 1 is never seen.

Reply via email to