This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[alias-export, trunk] Handle TARGET_MEM_REFs in execute_update_address_taken
- From: Andrey Belevantsev <abel at ispras dot ru>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 28 Apr 2009 19:53:09 +0400
- Subject: [alias-export, trunk] Handle TARGET_MEM_REFs in execute_update_address_taken
Hello,
As expand from SSA patch went in, I have merged alias-export branch with
trunk rev. 146874. While doing this, I had some new bootstrap ices when
rebuilding alias information after uncprop. The problem was that while
handling TARGET_MEM_REFs in statement rhs, walk_stmt_load_store_addr_ops
didn't check for NULL TMR_BASE, and also it didn't check for T_M_R on
lhs at all. Fixed as suggested by richi on irc, bootstrapped with
TODO_rebuild_alias added to pass_uncprop, committed to alias-export
branch.
Okay for trunk also if bootstrap/regtest there succeeds (I will do that
both with and without rebuilding alias info to be sure)? Also, I can
wait until we agree whether to do a slush or not.
Andrey
2009-04-28 Andrey Belevantsev <abel@ispras.ru>
* tree-ssa.c (execute_update_address_taken): Handle TARGET_MEM_REF
when processing for not_regs_needed bitmap.
* gimple.c (walk_stmt_load_store_addr_ops): When visiting address,
handle TARGET_MEM_REF in lhs and check TMR_BASE for NULL while
handling it for rhs.
diff -cprd -x .svn -x TAGS trunk/gcc/gimple.c alias-export/gcc/gimple.c
*** trunk/gcc/gimple.c Tue Apr 28 11:40:37 2009
--- alias-export/gcc/gimple.c Tue Apr 28 18:10:40 2009
*************** walk_stmt_load_store_addr_ops (gimple st
*** 3238,3249 ****
--- 3238,3255 ----
if (TREE_CODE (rhs) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
else if (TREE_CODE (rhs) == TARGET_MEM_REF
+ && TMR_BASE (rhs) != NULL
&& TREE_CODE (TMR_BASE (rhs)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (rhs), 0), data);
else if (TREE_CODE (rhs) == OBJ_TYPE_REF
&& TREE_CODE (OBJ_TYPE_REF_OBJECT (rhs)) == ADDR_EXPR)
ret |= visit_addr (stmt, TREE_OPERAND (OBJ_TYPE_REF_OBJECT (rhs),
0), data);
+ lhs = gimple_assign_lhs (stmt);
+ if (TREE_CODE (lhs) == TARGET_MEM_REF
+ && TMR_BASE (lhs) != NULL
+ && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR)
+ ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), data);
}
if (visit_load)
{
diff -cprd -x .svn -x TAGS trunk/gcc/tree-ssa.c alias-export/gcc/tree-ssa.c
*** trunk/gcc/tree-ssa.c Tue Apr 28 11:40:36 2009
--- alias-export/gcc/tree-ssa.c Tue Apr 28 18:15:55 2009
*************** execute_update_addresses_taken (bool do_
*** 1514,1527 ****
a local decl that requires not to be a gimple register. */
if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
{
! tree lhs = gimple_get_lhs (stmt);
! /* A plain decl does not need it set. */
! if (lhs && handled_component_p (lhs))
! {
! var = get_base_address (lhs);
! if (DECL_P (var))
! bitmap_set_bit (not_reg_needs, DECL_UID (var));
! }
}
}
--- 1514,1531 ----
a local decl that requires not to be a gimple register. */
if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
{
! tree lhs = gimple_get_lhs (stmt);
!
! if (lhs && TREE_CODE (lhs) == TARGET_MEM_REF)
! lhs = TMR_SYMBOL (lhs);
!
! /* A plain decl does not need it set. */
! if (lhs && handled_component_p (lhs))
! {
! var = get_base_address (lhs);
! if (DECL_P (var))
! bitmap_set_bit (not_reg_needs, DECL_UID (var));
! }
}
}