Commit 15d5fe33 by Daniel Berlin Committed by Daniel Berlin

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
parent 84541525
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.
......
......@@ -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)
{
......
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