Commit 0e256a82 by Andrew Pinski Committed by Andrew Pinski

fold-const.c (fold_build_cleanup_point_expr): For a RETURN_EXPR...

2004-12-28  Andrew Pinski  <pinskia@physics.uc.edu>

        * fold-const.c (fold_build_cleanup_point_expr): For a RETURN_EXPR,
        we only need a cleanup point expression when the expression on the
        left hand side of the MODIFIY_EXPR inside the return has side
        effects.

From-SVN: r92672
parent 2b0729ba
2004-12-28 Andrew Pinski <pinskia@physics.uc.edu>
* fold-const.c (fold_build_cleanup_point_expr): For a RETURN_EXPR,
we only need a cleanup point expression when the expression on the
left hand side of the MODIFIY_EXPR inside the return has side
effects.
2004-12-28 Dorit Naishlos <dorit@il.ibm.com>
* tree-vectorizer.c (vect_mark_relevant) First argument changed from
......
......@@ -10784,6 +10784,21 @@ fold_build_cleanup_point_expr (tree type, tree expr)
if (!TREE_SIDE_EFFECTS (expr))
return expr;
/* If the expression is a return, check to see if the expression inside the
return has no side effects or the right hand side of the modify expression
inside the return. If either don't have side effects set we don't need to
wrap the expression in a cleanup point expression. Note we don't check the
left hand side of the modify because it should always be a return decl. */
if (TREE_CODE (expr) == RETURN_EXPR)
{
tree op = TREE_OPERAND (expr, 0);
if (!op || !TREE_SIDE_EFFECTS (op))
return expr;
op = TREE_OPERAND (op, 1);
if (!TREE_SIDE_EFFECTS (op))
return expr;
}
return build1 (CLEANUP_POINT_EXPR, type, expr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment