if (!genop1)
return NULL_TREE;
genop1 = fold_convert (build_pointer_type (currop->type),
- genop1);
+ genop1);
folded = fold_build1 (currop->opcode, currop->type,
- genop1);
+ genop1);
return folded;
}
}
stmts, domstmt);
if (!genop1 || !genop2)
return NULL_TREE;
+ genop1 = fold_convert (TREE_TYPE (nary->op[0]),
+ genop1);
/* Ensure op2 is a sizetype for POINTER_PLUS_EXPR. It
may be a constant with the wrong type. */
if (nary->opcode == POINTER_PLUS_EXPR)
genop2 = fold_convert (sizetype, genop2);
+ else
+ genop2 = fold_convert (TREE_TYPE (nary->op[0]), genop2);
+
folded = fold_build2 (nary->opcode, nary->type,
genop1, genop2);
}
stmts, domstmt);
if (!genop1)
return NULL_TREE;
+ genop1 = fold_convert (TREE_TYPE (nary->op[0]), genop1);
+
folded = fold_build1 (nary->opcode, nary->type,
genop1);
}
else
gcc_unreachable ();
}
+
/* If there is no existing leader but SCCVN knows this
value is constant, use that constant. */
if (!sprime && is_gimple_min_invariant (VN_INFO (lhs)->valnum))
{
- sprime = VN_INFO (lhs)->valnum;
+ sprime = fold_convert (TREE_TYPE (lhs),
+ VN_INFO (lhs)->valnum);
if (dump_file && (dump_flags & TDF_DETAILS))
{
if (!run_scc_vn (do_fre))
{
if (!do_fre)
- remove_dead_inserted_code ();
+ {
+ remove_dead_inserted_code ();
+ loop_optimizer_finalize ();
+ }
+
return 0;
}
init_pre (do_fre);