This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors


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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
If we should pay attention to the sign, then maybe

--- gcc/c-family/c-common.c
+++ gcc/c-family/c-common.c
@@ -11903,9 +11903,9 @@ vector_types_compatible_elements_p (tree t1, tree t2)
              && (c2 == INTEGER_TYPE || c2 == REAL_TYPE
                  || c2 == FIXED_POINT_TYPE));

-  t1 = c_common_signed_type (t1);
-  t2 = c_common_signed_type (t2);
-  /* Equality works here because c_common_signed_type uses
+  t1 = c_common_signed_or_unsigned_type (TYPE_UNSIGNED (t1), t1);
+  t2 = c_common_signed_or_unsigned_type (TYPE_UNSIGNED (t2), t2);
+  /* Equality works here because c_common_signed_or_unsigned_type uses
      TYPE_MAIN_VARIANT.  */
   if (t1 == t2)
     return true;

(it has a small fallout)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]