c-typeck.c (convert_for_assignment): Use vector_targets_convertible_p.
* 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. * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p. (comp_ptr_ttypes_const): Likewise. * g++.dg/other/opaque-1.C, g++.dg/other/opaque-2.C, g++.dg/other/opaque-3.C: Also run on powerpc*-*-linux*spe*. From-SVN: r137325
This commit is contained in:
parent
103a641100
commit
f83c7f631f
11 changed files with 51 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
|||
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
|
||||
|
|
|
@ -1207,6 +1207,20 @@ check_main_parameter_types (tree decl)
|
|||
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
|
||||
|
|
|
@ -824,6 +824,7 @@ extern tree finish_label_address_expr (tree);
|
|||
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 *);
|
||||
|
|
|
@ -4196,10 +4196,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
|
|||
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
|
||||
|
|
|
@ -22332,7 +22332,6 @@ rs6000_is_opaque_type (const_tree type)
|
|||
{
|
||||
return (type == opaque_V2SI_type_node
|
||||
|| type == opaque_V2SF_type_node
|
||||
|| type == opaque_p_V2SI_type_node
|
||||
|| type == opaque_V4SI_type_node);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -7164,6 +7164,7 @@ static int
|
|||
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))
|
||||
{
|
||||
|
@ -7198,9 +7199,13 @@ comp_ptr_ttypes_real (tree to, tree from, int constp)
|
|||
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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7261,6 +7266,8 @@ ptr_reasonably_similar (const_tree to, const_tree 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))
|
||||
|
@ -7271,8 +7278,12 @@ comp_ptr_ttypes_const (tree to, tree 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { 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__;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { 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)))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* { dg-do compile { target powerpc-*-eabi* } } */
|
||||
/* { dg-do compile { target powerpc-*-eabi* powerpc*-*-linux*spe* } } */
|
||||
/* { dg-options "-mcpu=8540 -mabi=spe" } */
|
||||
|
||||
__ev64_opaque__ o;
|
||||
|
|
Loading…
Add table
Reference in a new issue