From 0af94e6f263316ba608487859827f87696bbf377 Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Sun, 8 Sep 2013 06:16:24 +0000 Subject: c-common.c (same_scalar_type_ignoring_signedness): Delete. gcc/c-family: * c-common.c (same_scalar_type_ignoring_signedness): Delete. (vector_types_compatible_elements_p): New function. * c-common.h: (same_scalar_type_ignoring_signedness): Delete declaration. (vector_types_compatible_elements_p): Declare. gcc/c: * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p. gcc/cp: * typeck.c (cp_build_binary_op): Use vector_types_compatible_elements_p. gcc/testsuite: * c-c++-common/opaque-vector.c: New test. From-SVN: r202364 --- gcc/c/ChangeLog | 4 ++++ gcc/c/c-typeck.c | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3401228..1b4b297 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2013-09-08 Joern Rennecke + + * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p. + 2013-09-03 Gabriel Dos Reis * c-objc-common.c (c_tree_printer): Tidy. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index f29ca04..e52533e 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -9987,7 +9987,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) { tree intt; - if (TREE_TYPE (type0) != TREE_TYPE (type1)) + if (!vector_types_compatible_elements_p (type0, type1)) { error_at (location, "comparing vectors with different " "element types"); @@ -10124,7 +10124,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) { tree intt; - if (TREE_TYPE (type0) != TREE_TYPE (type1)) + if (!vector_types_compatible_elements_p (type0, type1)) { error_at (location, "comparing vectors with different " "element types"); @@ -10230,8 +10230,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE && (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1)) - || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0), - TREE_TYPE (type1)))) + || !vector_types_compatible_elements_p (type0, type1))) { binary_op_error (location, code, type0, type1); return error_mark_node; -- cgit v1.1