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

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

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch to restore the vectorization GCC 15 does, but forwprop doesn't
pick up the slack.  This regressed with r16-6292-ge8fd095091ebfc which
added

@@ -4011,6 +4017,9 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi)
          if (CONVERT_EXPR_CODE_P (conv_code)
              && (2 * TYPE_PRECISION (TREE_TYPE (TREE_TYPE (orig[0])))
                  == TYPE_PRECISION (TREE_TYPE (type)))
+             && orig_elem_type[0]
+             && useless_type_conversion_p (orig_elem_type[0],
+                                           TREE_TYPE (type))
              && mode_for_vector (as_a <scalar_mode>
                                  (TYPE_MODE (TREE_TYPE (TREE_TYPE
(orig[0])))),
                                  nelts * 2).exists ()

which effectively disables unpacking.  I think it wants to check whether
the BIT_FIELD_REF of the vector is changing the sign of the vector element.
Thus TREE_TYPE (TREE_TYPE (orig[0])) instead of TREE_TYPE (type).

Testing the two pieces of the fix.

Reply via email to