aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRevital Eres <eres@il.ibm.com>2007-03-25 06:53:02 +0000
committerRevital Eres <revitale@gcc.gnu.org>2007-03-25 06:53:02 +0000
commit3ece6cc239ce0f85c306e3a2800582e6d8499b8d (patch)
tree66f8652781f8f67bf521e7f0d504d074b32dabc2 /gcc
parente65a3857a5b89f314ceeecb2edd4c244bde3872b (diff)
downloadgcc-3ece6cc239ce0f85c306e3a2800582e6d8499b8d.zip
gcc-3ece6cc239ce0f85c306e3a2800582e6d8499b8d.tar.gz
gcc-3ece6cc239ce0f85c306e3a2800582e6d8499b8d.tar.bz2
fix in tree-if-conv.c
From-SVN: r123194
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-if-conv.c17
2 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ae81fcd..a8902bf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-25 Revital Eres <eres@il.ibm.com>
+
+ * tree-if-conv.c (if_convertible_gimple_modify_stmt_p):
+ Fold movement_possibility function into it.
+
2007-03-25 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/darwin.md (load_macho_picbase): Ignore operand 0.
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 7d1a838..709c414 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -346,17 +346,28 @@ static bool
if_convertible_gimple_modify_stmt_p (struct loop *loop, basic_block bb,
tree m_expr)
{
+ tree lhs, rhs;
+
+ if (TREE_CODE (m_expr) != GIMPLE_MODIFY_STMT)
+ return false;
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "-------------------------\n");
print_generic_stmt (dump_file, m_expr, TDF_SLIM);
}
- /* Be conservative and do not handle immovable expressions. */
- if (movement_possibility (m_expr) == MOVE_IMPOSSIBLE)
+ lhs = GIMPLE_STMT_OPERAND (m_expr, 0);
+ rhs = GIMPLE_STMT_OPERAND (m_expr, 1);
+
+ /* Some of these constrains might be too conservative. */
+ if (stmt_ends_bb_p (m_expr) || stmt_ann (m_expr)->has_volatile_ops
+ || (TREE_CODE (lhs) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ || TREE_SIDE_EFFECTS (rhs))
{
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "stmt is movable. Don't take risk\n");
+ fprintf (dump_file, "stmt not suitable for ifcvt\n");
return false;
}