> 2011-06-28 Eric Botcazou <[email protected]>
>
> * tree-ssa-dom.c (initialize_hash_element): Fix oversight.
As reported under PR tree-optimization/49572, using the type of the LHS like in
the other cases leads to optimization regressions. The attached patch changes
this to use the type of RHS instead in the GIMPLE_SINGLE_RHS case.
Tested on x86_64-suse-linux, pre-approved by Richard in the PR, applied.
2011-06-30 Eric Botcazou <[email protected]>
PR tree-optimization/49572
* tree-ssa-dom.c (initialize_hash_element) <GIMPLE_SINGLE_RHS>: Use the
type of the RHS instead of that of the LHS for the expression type.
--
Eric Botcazou
Index: tree-ssa-dom.c
===================================================================
--- tree-ssa-dom.c (revision 175621)
+++ tree-ssa-dom.c (working copy)
@@ -208,13 +208,11 @@ initialize_hash_element (gimple stmt, tr
{
enum tree_code subcode = gimple_assign_rhs_code (stmt);
- expr->type = NULL_TREE;
-
switch (get_gimple_rhs_class (subcode))
{
case GIMPLE_SINGLE_RHS:
expr->kind = EXPR_SINGLE;
- expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
+ expr->type = TREE_TYPE (gimple_assign_rhs1 (stmt));
expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
break;
case GIMPLE_UNARY_RHS: