+2005-10-08 Janis Johnson <janis187@us.ibm.com>
+
+ Partial backport from mainline
+ 2004-05-04 Paolo Bonzini <bonzini@gnu.org>
+ Richard Henderson <rth@redhat.com>
+ * c-common.c (vector_types_convertible_p): New function.
+ * c-common.h: Declare it.
+ * c-typeck.c (digest_init): Use it.
+
2005-10-07 James E Wilson <wilson@specifix.com>
PR target/23644
return !TREE_OVERFLOW (c);
}
+/* Nonzero if vector types T1 and T2 can be converted to each other
+ without an explicit cast. */
+int
+vector_types_convertible_p (tree t1, tree t2)
+{
+ return targetm.vector_opaque_p (t1)
+ || targetm.vector_opaque_p (t2)
+ || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))
+ && INTEGRAL_TYPE_P (TREE_TYPE (t1))
+ == INTEGRAL_TYPE_P (TREE_TYPE (t2)));
+}
+
/* Convert EXPR to TYPE, warning about conversion problems with constants.
Invoke this function on every expression that is converted implicitly,
i.e. because of language rules and not because of an explicit cast. */
different implementations. Used in c-common.c. */
extern tree lookup_label (tree);
+extern int vector_types_convertible_p (tree t1, tree t2);
+
extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
extern int c_safe_from_p (rtx, tree);
vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
below and handle as a constructor. */
if (code == VECTOR_TYPE
- && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT)
+ && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
+ && vector_types_convertible_p (TREE_TYPE (inside_init), type)
&& TREE_CONSTANT (inside_init))
{
if (TREE_CODE (inside_init) == VECTOR_CST
+2005-10-08 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/altivec-pr18583.c: New test.
+
2005-09-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23965
--- /dev/null
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "-maltivec" } { "" } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+static const vector signed short c[1] =
+ {(const vector signed short){4095, 5681, 5351, 4816, 4095, 4816, 5351, 5681}};