]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-pre.c (insert_into_preds_of_block): Don't rewrite constant part of expression.
authorDaniel Berlin <dberlin@dberlin.org>
Mon, 20 Oct 2008 21:23:22 +0000 (21:23 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Mon, 20 Oct 2008 21:23:22 +0000 (21:23 +0000)
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

gcc/ChangeLog
gcc/tree-ssa-pre.c

index a7f733f113471b42e77ebc7f37b19fd072b05f34..ce553c6bf83fa8ced853a2e0a0f2a9ef348556c5 100644 (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.
index f57500e62ace83520969b6b0c6e536d48b26dd0a..dc576c5a3d7d615605b89ef9c37507bc063762a5 100644 (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)
                        {