diff options
author | Richard Henderson <rth@redhat.com> | 2004-07-07 13:16:00 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-07-07 13:16:00 -0700 |
commit | 63b8825280dc6eac8ff82c577c15831a150c1c40 (patch) | |
tree | c942eab68cbe4fd2928d53b1721538ff35b54f5d /gcc/tree-ssa-dom.c | |
parent | 6c4918da7335aa1a76ad468594762cffbef822a7 (diff) | |
download | gcc-63b8825280dc6eac8ff82c577c15831a150c1c40.zip gcc-63b8825280dc6eac8ff82c577c15831a150c1c40.tar.gz gcc-63b8825280dc6eac8ff82c577c15831a150c1c40.tar.bz2 |
tree-flow-inline.h (may_propagate_copy): Move...
* tree-flow-inline.h (may_propagate_copy): Move...
* tree-ssa-copy.c (may_propagate_copy): ... here. Fail if we
attempt to copy between types requiring conversion.
* tree-flow.h (may_propagate_copy): Update decl.
* tree-ssa-dom.c (cprop_operand): Tidy redundant tests.
From-SVN: r84225
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 356daac..c03e2bb 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -2906,24 +2906,24 @@ cprop_operand (stmt_ann_t ann, use_operand_p op_p, varray_type const_and_copies) val_type = TREE_TYPE (val_type); } - /* Make sure underlying types match before propagating a - constant by converting the constant to the proper type. Note - that convert may return a non-gimple expression, in which case - we ignore this propagation opportunity. */ - if (!lang_hooks.types_compatible_p (op_type, val_type) - && TREE_CODE (val) != SSA_NAME) + /* Make sure underlying types match before propagating a constant by + converting the constant to the proper type. Note that convert may + return a non-gimple expression, in which case we ignore this + propagation opportunity. */ + if (TREE_CODE (val) != SSA_NAME) { - val = fold_convert (TREE_TYPE (op), val); - if (!is_gimple_min_invariant (val) - && TREE_CODE (val) != SSA_NAME) - return false; + if (!lang_hooks.types_compatible_p (op_type, val_type)) + { + val = fold_convert (TREE_TYPE (op), val); + if (!is_gimple_min_invariant (val)) + return false; + } } /* Certain operands are not allowed to be copy propagated due to their interaction with exception handling and some GCC extensions. */ - if (TREE_CODE (val) == SSA_NAME - && !may_propagate_copy (op, val)) + else if (!may_propagate_copy (op, val)) return false; /* Dump details. */ |