tree-ssa-pre.c (insert_into_preds_of_block): Don't rewrite constant part of expression.

2008-10-20  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (insert_into_preds_of_block): Don't rewrite constant
	part of expression.

From-SVN: r141249
This commit is contained in:
Daniel Berlin 2008-10-20 21:23:22 +00:00 committed by Daniel Berlin
parent 8454152598
commit 15d5fe337e
2 changed files with 8 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2008-10-20 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (insert_into_preds_of_block): Don't rewrite constant
part of expression.
2008-10-20 Tobias Schlüter <tobi@gcc.gnu.org>
* doc/install.texi: Fix typos in previous patch.

View File

@ -3019,23 +3019,15 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
should give us back a constant with the right type.
*/
tree constant = PRE_EXPR_CONSTANT (eprime);
if (TREE_TYPE (constant) != type)
if (!useless_type_conversion_p (type, TREE_TYPE (constant)))
{
tree builtexpr = fold_convert (type, constant);
if (is_gimple_min_invariant (builtexpr))
{
PRE_EXPR_CONSTANT (eprime) = builtexpr;
}
else
if (!is_gimple_min_invariant (builtexpr))
{
tree forcedexpr = force_gimple_operand (builtexpr,
&stmts, true,
NULL);
if (is_gimple_min_invariant (forcedexpr))
{
PRE_EXPR_CONSTANT (eprime) = forcedexpr;
}
else
if (!is_gimple_min_invariant (forcedexpr))
{
if (forcedexpr != builtexpr)
{