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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/match.pd b/gcc/match.pd
index 876a9d1c06e..abbd03742f9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6792,11 +6792,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
               && exact_real_truncate (TYPE_MODE (double_type_node), &orig))
             type1 = double_type_node;
         }
-      tree newtype
-        = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
-          ? TREE_TYPE (@00) : type1);
+       tree newtype
+        = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
+           ? TREE_TYPE (@00) : type1);
      }
-     (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype))
+     (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype)
+         && is_truth_type_for (newtype, type))
       (cmp (convert:newtype @00) (convert:newtype @10))))))))


as I thought with AVX512VL we can handle this, but for V2SFmode we get
V2SImode as mask_mode.  And changing the test to V4SF/V4DFmode reveals
that we don't use float-extend (I'd have to trace vector lowering and
forwprop).  There might be an opportunity to improve what we do
for convertvector.

But it fixes the testcase.

Reply via email to