------- Comment #9 from steven at gcc dot gnu dot org  2008-12-23 18:51 -------
Hack demonstrates the problem:

Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c      (revision 142907)
+++ tree-ssa-pre.c      (working copy)
@@ -3274,6 +3274,17 @@ do_regular_insertion (basic_block block, basic_blo
                }
              else
                {
+                 /* For PRE of comparisons, we have to make sure
+                    that the result is of the proper type.  */
+                 if (edoubleprime->kind == CONSTANT
+                     && expr->kind == NARY
+                     && TREE_CODE_CLASS (PRE_EXPR_NARY (expr)->opcode)
+                        == tcc_comparison)
+                   {
+                     PRE_EXPR_CONSTANT (edoubleprime) =
+                       fold_convert (get_expr_type (expr),
+                                     PRE_EXPR_CONSTANT (edoubleprime));
+                   }
                  avail[bprime->index] = edoubleprime;
                  by_some = true;
                  if (first_s == NULL)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38564

Reply via email to