Commit 1af928db by Richard Biener Committed by Richard Biener

gimple-fold.c (fold_stmt_1): Check may_propagate_copy before valueizing return stmts.

2016-11-25  Richard Biener  <rguenther@suse.de>

	* gimple-fold.c (fold_stmt_1): Check may_propagate_copy
	before valueizing return stmts.

From-SVN: r242873
parent 59ec925b
2016-11-25 Richard Biener <rguenther@suse.de>
* gimple-fold.c (fold_stmt_1): Check may_propagate_copy
before valueizing return stmts.
2016-11-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/78343
......@@ -4414,7 +4414,8 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace, tree (*valueize) (tree))
if (ret && TREE_CODE (ret) == SSA_NAME && valueize)
{
tree val = valueize (ret);
if (val && val != ret)
if (val && val != ret
&& may_propagate_copy (ret, val))
{
gimple_return_set_retval (ret_stmt, val);
changed = true;
......
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