aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2005-06-15 10:33:51 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2005-06-15 10:33:51 +0000
commit5bed876a0279849a661718d5a63c741652a4ecae (patch)
treecddc58e82c86c8f543c8c9fe3f96bcc986824672 /gcc/c-common.c
parentd7f88d86489c2d9868994347173c0b9d5f7ef285 (diff)
downloadgcc-5bed876a0279849a661718d5a63c741652a4ecae.zip
gcc-5bed876a0279849a661718d5a63c741652a4ecae.tar.gz
gcc-5bed876a0279849a661718d5a63c741652a4ecae.tar.bz2
c-common.h (same_scalar_type_ignoring_signedness): Protoize.
* c-common.h (same_scalar_type_ignoring_signedness): Protoize. * c-common.c (same_scalar_type_ignoring_signedness): New. * c-typeck.c (build_binary_op): Check compatability of vector types. Move error report after switch. Do not clobber code[01] on *_DIV_EXPR case. * testsuite/gcc.dg/simd-1.c: Update error messages. * testsuite/gcc.dg/simd-1b.c: Re-enable tests. Update error messages. * testsuite/gcc.dg/simd-2.c: Update error messages. * testsuite/gcc.dg/simd-4.c: New. From-SVN: r100976
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 237f7d3..b7263aa 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -6030,4 +6030,19 @@ resolve_overloaded_builtin (tree function, tree params)
}
}
+/* Ignoring their sign, return true if two scalar types are the same. */
+bool
+same_scalar_type_ignoring_signedness (tree t1, tree t2)
+{
+ enum tree_code c1 = TREE_CODE (t1), c2 = TREE_CODE (t2);
+
+ gcc_assert ((c1 == INTEGER_TYPE || c1 == REAL_TYPE)
+ && (c2 == INTEGER_TYPE || c2 == REAL_TYPE));
+
+ /* Equality works here because c_common_signed_type uses
+ TYPE_MAIN_VARIANT. */
+ return lang_hooks.types.signed_type (t1)
+ == lang_hooks.types.signed_type (t2);
+}
+
#include "gt-c-common.h"