+2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * c-typeck.c (convert_for_assignment): Use
+ vector_targets_convertible_p.
+ * c-common.c (vector_targets_convertible_p): New.
+ * c-common.h (vector_targets_convertible_p): New prototype.
+ * config/rs6000/rs6000.c (rs6000_is_opaque_type): Do not check
+ opaque_p_V2SI_type_node.
+
2008-07-01 Steve Ellcey <sje@cup.hp.com>
* config/ia64/ia64.c (ia64_cannot_force_const_mem): Do not allow
pedwarn ("%q+D takes only zero or two arguments", decl);
}
+/* True if pointers to distinct types T1 and T2 can be converted to
+ each other without an explicit cast. Only returns true for opaque
+ vector types. */
+bool
+vector_targets_convertible_p (const_tree t1, const_tree t2)
+{
+ if (TREE_CODE (t1) == VECTOR_TYPE && TREE_CODE (t2) == VECTOR_TYPE
+ && (targetm.vector_opaque_p (t1) || targetm.vector_opaque_p (t2))
+ && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
+ return true;
+
+ return false;
+}
+
/* True if vector types T1 and T2 can be converted to each other
without an explicit cast. If EMIT_LAX_NOTE is true, and T1 and T2
can only be converted with -flax-vector-conversions yet that is not
extern tree lookup_label (tree);
extern tree lookup_name (tree);
+extern bool vector_targets_convertible_p (const_tree t1, const_tree t2);
extern bool vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note);
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
if (TREE_CODE (mvr) != ARRAY_TYPE)
mvr = TYPE_MAIN_VARIANT (mvr);
/* Opaque pointers are treated like void pointers. */
- is_opaque_pointer = (targetm.vector_opaque_p (type)
- || targetm.vector_opaque_p (rhstype))
- && TREE_CODE (ttl) == VECTOR_TYPE
- && TREE_CODE (ttr) == VECTOR_TYPE;
+ is_opaque_pointer = vector_targets_convertible_p (ttl, ttr);
/* C++ does not allow the implicit conversion void* -> T*. However,
for the purpose of reducing the number of false positives, we
{
return (type == opaque_V2SI_type_node
|| type == opaque_V2SF_type_node
- || type == opaque_p_V2SI_type_node
|| type == opaque_V4SI_type_node);
}
+2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
+ (comp_ptr_ttypes_const): Likewise.
+
2008-07-01 Andrew Haley <aph@redhat.com>
* decl.c (finish_constructor_body): Don't set the return value of
comp_ptr_ttypes_real (tree to, tree from, int constp)
{
bool to_more_cv_qualified = false;
+ bool is_opaque_pointer = false;
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
constp &= TYPE_READONLY (to);
}
+ if (TREE_CODE (to) == VECTOR_TYPE)
+ is_opaque_pointer = vector_targets_convertible_p (to, from);
+
if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
return ((constp >= 0 || to_more_cv_qualified)
- && same_type_ignoring_top_level_qualifiers_p (to, from));
+ && (is_opaque_pointer
+ || same_type_ignoring_top_level_qualifiers_p (to, from)));
}
}
bool
comp_ptr_ttypes_const (tree to, tree from)
{
+ bool is_opaque_pointer = false;
+
for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
{
if (TREE_CODE (to) != TREE_CODE (from))
TYPE_OFFSET_BASETYPE (to)))
continue;
+ if (TREE_CODE (to) == VECTOR_TYPE)
+ is_opaque_pointer = vector_targets_convertible_p (to, from);
+
if (TREE_CODE (to) != POINTER_TYPE)
- return same_type_ignoring_top_level_qualifiers_p (to, from);
+ return (is_opaque_pointer
+ || same_type_ignoring_top_level_qualifiers_p (to, from));
}
}
+2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * g++.dg/other/opaque-1.C, g++.dg/other/opaque-2.C,
+ g++.dg/other/opaque-3.C: Also run on powerpc*-*-linux*spe*.
+
2008-07-01 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/quad-sse.c: New test.
-/* { dg-do run { target powerpc-*-eabispe* } } */
+/* { dg-do run { target powerpc-*-eabispe* powerpc*-*-linux*spe* } } */
#define __vector __attribute__((vector_size(8)))
typedef float __vector __ev64_fs__;
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile { target powerpc-*-eabi* powerpc*-*-linux*spe* } } */
/* { dg-options "-mcpu=8540 -mabi=spe" } */
#define __vector __attribute__((vector_size(8)))
-/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-do compile { target powerpc-*-eabi* powerpc*-*-linux*spe* } } */
/* { dg-options "-mcpu=8540 -mabi=spe" } */
__ev64_opaque__ o;