From: Richard Biener Date: Thu, 2 Dec 2021 11:21:19 +0000 (+0100) Subject: tree-optimization/103527 - always use thruth type forgather mask X-Git-Tag: basepoints/gcc-13~2605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70ece2d4ca403dfc6a837d876642378a8d4d3dce;p=thirdparty%2Fgcc.git tree-optimization/103527 - always use thruth type forgather mask This makes sure to always use a truth type to build the gather mask argument even when the target builtin prototype in the end wants a float vector. 2021-12-02 Richard Biener PR tree-optimization/103527 * tree-vect-stmts.c (vect_build_gather_load_calls): Always use a truth type for building the vector mask. --- diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 9726450ab2dc..e63bc2afdaaf 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -2740,7 +2740,7 @@ vect_build_gather_load_calls (vec_info *vinfo, stmt_vec_info stmt_info, && (!mask || TREE_CODE (masktype) == INTEGER_TYPE || types_compatible_p (srctype, masktype))); - if (mask && TREE_CODE (masktype) == INTEGER_TYPE) + if (mask) masktype = truth_type_for (srctype); tree mask_halftype = masktype; @@ -2893,7 +2893,8 @@ vect_build_gather_load_calls (vec_info *vinfo, stmt_vec_info stmt_info, if (masktype != real_masktype) { tree utype, optype = TREE_TYPE (mask_op); - if (TYPE_MODE (real_masktype) == TYPE_MODE (optype)) + if (VECTOR_TYPE_P (real_masktype) + || TYPE_MODE (real_masktype) == TYPE_MODE (optype)) utype = real_masktype; else utype = lang_hooks.types.type_for_mode (TYPE_MODE (optype), 1);