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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
fold_view_convert_vector_encoding is called with vector(4) <signed-boolean:1>
and { -1, -1, 0, 0, 0, 0, 0, 0 } (4 lane result of 8 lane expression).
That, and

  if (!poly_int_tree_p (TYPE_SIZE (type), &type_bits)
      || !poly_int_tree_p (TYPE_SIZE (expr_type), &expr_bits))
    return NULL_TREE;

is what ultimatively confuses us.  TYPE_SIZE is going to be wrong for
QImode which can hold two, four and 8 bits of mask but each with a single
bit per element, so

  poly_uint64 type_units = TYPE_VECTOR_SUBPARTS (type);
  poly_uint64 expr_units = TYPE_VECTOR_SUBPARTS (expr_type);
  unsigned int type_elt_bits = vector_element_size (type_bits, type_units);
  unsigned int expr_elt_bits = vector_element_size (expr_bits, expr_units);

will be wrongly saying we use 2 bits for 4 element masks in a QImode vector.

element_precision () is correct here.

Now, it might be suspicious to do the VIEW_CONVERT_EXPR here, but the
modes are equal, so that should be fine (it's also accepted by the type
verifier which compares TYPE_SIZE).

I'm testing using element_precision.

Reply via email to