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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is

-t2.c:13:3: note: vect_is_simple_use: operand _1
-t2.c:13:3: note: def_stmt: _1 = i_14 <= 4;
-t2.c:13:3: note: type of def: internal
-t2.c:13:3: note: vect_is_simple_use: operand _1
-t2.c:13:3: note: def_stmt: _1 = i_14 <= 4;
-t2.c:13:3: note: type of def: internal
-t2.c:13:3: note: vect_recog_bool_pattern: detected:
-t2.c:13:3: note: bool pattern recognized: patt_12 = _1 ? 1 : 0;

which isn't detected if I make 'data' the enum type vs. unsigned int.

Fix:

Index: gcc/tree-vect-patterns.c
===================================================================
--- gcc/tree-vect-patterns.c    (revision 253134)
+++ gcc/tree-vect-patterns.c    (working copy)
@@ -3643,7 +3643,7 @@ vect_recog_bool_pattern (vec<gimple *> *
   rhs_code = gimple_assign_rhs_code (last_stmt);
   if (CONVERT_EXPR_CODE_P (rhs_code))
     {
-      if (TREE_CODE (TREE_TYPE (lhs)) != INTEGER_TYPE
+      if (! INTEGRAL_TYPE_P (TREE_TYPE (lhs))
          || TYPE_PRECISION (TREE_TYPE (lhs)) == 1)
        return NULL;
       vectype = get_vectype_for_scalar_type (TREE_TYPE (lhs));

Reply via email to