aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-07-02 11:53:08 +0000
committerRichard Guenther <rguenther@suse.de>2007-07-02 11:53:08 +0000
commitc1d24ed612c3e6ad57c19f2e60ba52f9b7007bf2 (patch)
tree3d0ceb6622e9dd1148a3d0ed7aa630d1fae0d3e8 /gcc/tree-ssa-ccp.c
parente189d744b0be09121ec3b86d3b1cea2cbd3cdb13 (diff)
2007-07-02 Richard Guenther <rguenther@suse.de>
* tree-flow.h (types_compatible_p): Declare. * tree-ssa.c (types_compatible_p): New function. * ipa-type-escape.c (discover_unique_type): Use types_compatible_p instead of lang_hooks.types_compatible_p. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-vn.c (expressions_equal_p): Likewise. * tree.c (fields_compatible_p): Likewise. * tree-ssa-dom.c (avail_expr_eq): Likewise. (cprop_operand): Use useless_type_conversion_p instead of lang_hooks.types_compatible_p. * tree-inline.c (setup_one_parameter): Likewise. (declare_return_variable): Likewise. * tree-nrv.c (tree_nrv): Likewise. * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_offset_to_component_ref): Likewise. (maybe_fold_offset_to_reference): Likewise. * tree-ssa-copy.c (may_propagate_copy): Likewise. (merge_alias_info): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-phiopt.c (conditional_replacement): Likewise. * tree-ssa-reassoc.c (optimize_ops_list): Likewise. * tree-tailcall.c (find_tail_calls): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * gimplify.c (canonicalize_addr_expr): Likewise. (fold_indirect_ref_rhs): Likewise. (gimplify_addr_expr): Likewise. Swap parameters to cpt_same_type. (cpt_same_type): Likewise. (check_pointer_types_r): Swap parameters to cpt_same_type where appropriate. * fold-const.c (fold_convert): Revert fix for PR15988. * tree-inline.c (setup_one_parameter): Instead fix it here by using fold_build1 instead of fold_convert and checking for error_mark_node. Convert only if the conversion is necessary. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@126198 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 1188f86484a..272a4f85741 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1575,7 +1575,7 @@ maybe_fold_offset_to_array_ref (tree base, tree offset, tree orig_type)
if (TREE_CODE (array_type) != ARRAY_TYPE)
return NULL_TREE;
elt_type = TREE_TYPE (array_type);
- if (!lang_hooks.types_compatible_p (orig_type, elt_type))
+ if (!useless_type_conversion_p (orig_type, elt_type))
return NULL_TREE;
/* Use signed size type for intermediate computation on the index. */
@@ -1666,7 +1666,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset,
return NULL_TREE;
/* Short-circuit silly cases. */
- if (lang_hooks.types_compatible_p (record_type, orig_type))
+ if (useless_type_conversion_p (record_type, orig_type))
return NULL_TREE;
tail_array_field = NULL_TREE;
@@ -1704,7 +1704,7 @@ maybe_fold_offset_to_component_ref (tree record_type, tree base, tree offset,
/* Here we exactly match the offset being checked. If the types match,
then we can return that field. */
if (cmp == 0
- && lang_hooks.types_compatible_p (orig_type, field_type))
+ && useless_type_conversion_p (orig_type, field_type))
{
if (base_is_ptr)
base = build1 (INDIRECT_REF, record_type, base);
@@ -1809,7 +1809,7 @@ maybe_fold_offset_to_reference (tree base, tree offset, tree orig_type)
sub_offset / BITS_PER_UNIT), 1);
}
}
- if (lang_hooks.types_compatible_p (orig_type, TREE_TYPE (base))
+ if (useless_type_conversion_p (orig_type, TREE_TYPE (base))
&& integer_zerop (offset))
return base;
type = TREE_TYPE (base);