* cp/Make-lang.in (cp/call.o): Add dependency for target.h.
* cp/call.c (standard_conversion): Support opaque types.
Include target.h.
(strip_top_quals): Use cp_build_qualified_type instead of
TYPE_MAIN_VARIANT.
* cp/typeck.c (convert_for_assignment): Support opaque types.
* testsuite/g++.dg/other/opaque-1.C: New.
* testsuite/g++.dg/other/opaque-2.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70223
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-08-07 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp/Make-lang.in (cp/call.o): Add dependency for target.h.
+
+ * cp/call.c (standard_conversion): Support opaque types.
+ Include target.h.
+ (strip_top_quals): Use cp_build_qualified_type instead of
+ TYPE_MAIN_VARIANT.
+
+ * cp/typeck.c (convert_for_assignment): Support opaque types.
+
+ * testsuite/g++.dg/other/opaque-1.C: New.
+
+ * testsuite/g++.dg/other/opaque-2.C: New.
+
2003-08-06 Aldy Hernandez <aldyh@redhat.com>
* decl.c (grokparms): Use cp_build_qualified_type instead
diagnostic.h convert.h
cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) convert.h
cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
- diagnostic.h intl.h gt-cp-call.h convert.h
+ diagnostic.h intl.h gt-cp-call.h convert.h target.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
except.h
#include "expr.h"
#include "diagnostic.h"
#include "intl.h"
+#include "target.h"
#include "convert.h"
static tree build_field_call (tree, tree, tree);
{
if (TREE_CODE (t) == ARRAY_TYPE)
return t;
- return TYPE_MAIN_VARIANT (t);
+ return cp_build_qualified_type (t, 0);
}
/* Returns the standard conversion path (see [conv]) from type FROM to type
&& ICS_STD_RANK (TREE_OPERAND (conv, 0)) <= PROMO_RANK)
ICS_STD_RANK (conv) = PROMO_RANK;
}
+ else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
+ && ((*targetm.vector_opaque_p) (from)
+ || (*targetm.vector_opaque_p) (to)))
+ return build_conv (STD_CONV, to, conv);
else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
&& is_properly_derived_from (from, to))
{
rhstype = TREE_TYPE (rhs);
coder = TREE_CODE (rhstype);
+ if (TREE_CODE (type) == VECTOR_TYPE && coder == VECTOR_TYPE
+ && ((*targetm.vector_opaque_p) (type)
+ || (*targetm.vector_opaque_p) (rhstype)))
+ return convert (type, rhs);
+
if (rhs == error_mark_node || rhstype == error_mark_node)
return error_mark_node;
if (TREE_CODE (rhs) == TREE_LIST && TREE_VALUE (rhs) == error_mark_node)
--- /dev/null
+/* { dg-do run { target powerpc-*-eabispe* } } */
+
+#define __vector __attribute__((vector_size(8)))
+typedef float __vector __ev64_fs__;
+
+__ev64_fs__ f;
+__ev64_opaque__ o;
+
+int here = 0;
+
+void bar (__ev64_opaque__ x)
+{
+ here = 0;
+}
+
+void bar (__ev64_fs__ x)
+{
+ here = 888;
+}
+
+int main ()
+{
+ f = o;
+ o = f;
+ bar (f);
+ if (here != 888)
+ return 1;
+ return 0;
+}
--- /dev/null
+/* { dg-do compile { target powerpc-*-eabi* } } */
+/* { dg-options "-mcpu=8540 -mabi=spe" } */
+
+#define __vector __attribute__((vector_size(8)))
+typedef float __vector __ev64_fs__;
+
+__ev64_fs__ f;
+__ev64_opaque__ o;
+
+extern void bar (__ev64_opaque__);
+
+int main ()
+{
+ f = o;
+ o = f;
+ bar (f);
+ return 0;
+}