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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think I have a patch.

Basically adding this to simplify_vector_constructor should work for most
cases.

  if (nelts == 1 && CONSTRUCTOR_NELTS (op) == 1)
    {
      tree op1 = CONSTRUCTOR_ELT (op, 0);
      if (useless_type_conversion_p (elem_type, TREE_TYPE (op1)))
        {
          op1 = build1 (VIEW_CONVERT_EXPR, type, op1);
          gimple_assign_set_rhs_from_tree (gsi, op1);
          update_stmt (gsi_stmt (*gsi));
          return true;
        }
    }

Reply via email to