re PR tree-optimization/30590 (tree-nrv optimization clobbers return variable)

2007-03-15  Seongbae Park <seongbae.park@gmail.com>

	PR tree-optimization/30590
	* tree-nrv.c (tree_nrv): Check for the partial update
	of the return value.

From-SVN: r122964
This commit is contained in:
Seongbae Park
2007-03-15 23:48:13 +00:00
committed by Seongbae Park
parent 842b7c4fa3
commit 385b2d3170
2 changed files with 14 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2007-03-15 Seongbae Park <seongbae.park@gmail.com>
PR tree-optimization/30590
* tree-nrv.c (tree_nrv): Check for the partial update
of the return value.
2007-03-14 Ian Lance Taylor <iant@google.com>
* tree-vrp.c (value_inside_range): Ignore fold warnings.

View File

@@ -163,6 +163,14 @@ tree_nrv (void)
result_type))
return 0;
}
else if (TREE_CODE (stmt) == MODIFY_EXPR)
{
tree addr = get_base_address (TREE_OPERAND (stmt, 0));
/* If there's any MODIFY of component of RESULT,
then bail out. */
if (addr && addr == result)
return 0;
}
}
}