aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2007-01-11 23:14:51 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2007-01-11 23:14:51 +0000
commit14e765da4a4a8a0fbb8aa32c28afaf2a749db0d7 (patch)
tree221bc5a9b3635c0b6f184d2c7ccd0df3f1b8904f /gcc
parent6e63e240606beba28ae7b2714c059323d96896d5 (diff)
downloadgcc-14e765da4a4a8a0fbb8aa32c28afaf2a749db0d7.zip
gcc-14e765da4a4a8a0fbb8aa32c28afaf2a749db0d7.tar.gz
gcc-14e765da4a4a8a0fbb8aa32c28afaf2a749db0d7.tar.bz2
c-common.c (vector_types_convertible_p): Treat opaque types as always convertible if they have the same size...
* c-common.c (vector_types_convertible_p): Treat opaque types as always convertible if they have the same size, but not otherwise. From-SVN: r120688
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c20
2 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba94be3..1e737e7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-11 Joseph Myers <joseph@codesourcery.com>
+
+ * c-common.c (vector_types_convertible_p): Treat opaque types as
+ always convertible if they have the same size, but not otherwise.
+
2007-01-11 Steven Bosscher <steven@gcc.gnu.org>
* ifcvt.c (struct noce_if_info): Add comments to the fields.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index c1661b2..217228d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1091,14 +1091,18 @@ bool
vector_types_convertible_p (tree t1, tree t2, bool emit_lax_note)
{
static bool emitted_lax_note = false;
- bool convertible_lax =
- targetm.vector_opaque_p (t1)
- || targetm.vector_opaque_p (t2)
- || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))
- && (TREE_CODE (TREE_TYPE (t1)) != REAL_TYPE ||
- TYPE_PRECISION (t1) == TYPE_PRECISION (t2))
- && INTEGRAL_TYPE_P (TREE_TYPE (t1))
- == INTEGRAL_TYPE_P (TREE_TYPE (t2)));
+ bool convertible_lax;
+
+ if ((targetm.vector_opaque_p (t1) || targetm.vector_opaque_p (t2))
+ && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
+ return true;
+
+ convertible_lax =
+ (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))
+ && (TREE_CODE (TREE_TYPE (t1)) != REAL_TYPE ||
+ TYPE_PRECISION (t1) == TYPE_PRECISION (t2))
+ && (INTEGRAL_TYPE_P (TREE_TYPE (t1))
+ == INTEGRAL_TYPE_P (TREE_TYPE (t2))));
if (!convertible_lax || flag_lax_vector_conversions)
return convertible_lax;