diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2005-06-15 10:33:51 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2005-06-15 10:33:51 +0000 |
commit | 5bed876a0279849a661718d5a63c741652a4ecae (patch) | |
tree | cddc58e82c86c8f543c8c9fe3f96bcc986824672 /gcc/c-common.c | |
parent | d7f88d86489c2d9868994347173c0b9d5f7ef285 (diff) | |
download | gcc-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.c | 15 |
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" |