aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-08-03 10:30:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-08-03 10:30:46 +0000
commit907dd6ae395ec223ca3a410d199cac3a346ef8db (patch)
tree9149c79a96270471123654308ed9bc5256fbf44b /gcc/tree-ssa.c
parent2329c6f56d3724a337ed9dfcf5f0e7412a1406d8 (diff)
downloadgcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.zip
gcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.tar.gz
gcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.tar.bz2
tree.c (make_vector_type): Build a main variant first, get the canonical one and then build the variant.
2009-08-03 Richard Guenther <rguenther@suse.de> * tree.c (make_vector_type): Build a main variant first, get the canonical one and then build the variant. * tree-ssa.c (useless_type_conversion_p_1): Handle fixed-point types. (useless_type_conversion_p): Conversions to pointers to incomplete record types are useless. From-SVN: r150370
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index e8033cd..5044910 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -897,6 +897,11 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
&& SCALAR_FLOAT_TYPE_P (outer_type))
return true;
+ /* Fixed point types with the same mode are compatible. */
+ else if (FIXED_POINT_TYPE_P (inner_type)
+ && FIXED_POINT_TYPE_P (outer_type))
+ return true;
+
/* We need to take special care recursing to pointed-to types. */
else if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type))
@@ -1000,12 +1005,17 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
bool
useless_type_conversion_p (tree outer_type, tree inner_type)
{
- /* If the outer type is (void *), then the conversion is not
- necessary. We have to make sure to not apply this while
- recursing though. */
+ /* If the outer type is (void *) or a pointer to an incomplete record type,
+ then the conversion is not necessary.
+ We have to make sure to not apply this while recursing though. */
if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type)
- && TREE_CODE (TREE_TYPE (outer_type)) == VOID_TYPE)
+ && (VOID_TYPE_P (TREE_TYPE (outer_type))
+ || (AGGREGATE_TYPE_P (TREE_TYPE (outer_type))
+ && TREE_CODE (TREE_TYPE (outer_type)) != ARRAY_TYPE
+ && (TREE_CODE (TREE_TYPE (outer_type))
+ == TREE_CODE (TREE_TYPE (inner_type)))
+ && !COMPLETE_TYPE_P (TREE_TYPE (outer_type)))))
return true;
return useless_type_conversion_p_1 (outer_type, inner_type);