This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 17:51:53 +0000
- Subject: [Bug c/68062] [4.9/5/6 Regression] ICE when comparing vectors
- Auto-submitted: auto-generated
- References: <bug-68062-4 at http dot gcc dot gnu dot org/bugzilla/>
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)