This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][mem-ref2] Some fixes
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 13:54:48 +0200 (CEST)
- Subject: [PATCH][mem-ref2] Some fixes
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.
Richard.
2010-06-11 Richard Guenther <rguenther@suse.de>
* tree-ssa.c (execute_update_addresses_taken): Fix MEM_REF
partial use/def check.
Index: gcc/tree-ssa.c
===================================================================
*** gcc/tree-ssa.c (revision 160551)
--- gcc/tree-ssa.c (working copy)
*************** execute_update_addresses_taken (bool do_
*** 1839,1848 ****
if (DECL_P (lhs))
bitmap_set_bit (not_reg_needs, DECL_UID (lhs));
else if (TREE_CODE (lhs) == MEM_REF
! && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR
! && DECL_P (TREE_OPERAND (TREE_OPERAND (lhs, 0), 0))
! && !integer_zerop (TREE_OPERAND (lhs, 1)))
! bitmap_set_bit (not_reg_needs, DECL_UID (TREE_OPERAND (TREE_OPERAND (lhs, 0), 0)));
}
}
--- 1839,1853 ----
if (DECL_P (lhs))
bitmap_set_bit (not_reg_needs, DECL_UID (lhs));
else if (TREE_CODE (lhs) == MEM_REF
! && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR)
! {
! tree decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
! if (DECL_P (decl)
! && (!integer_zerop (TREE_OPERAND (lhs, 1))
! || (DECL_SIZE (decl)
! != TYPE_SIZE (TREE_TYPE (lhs)))))
! bitmap_set_bit (not_reg_needs, DECL_UID (decl));
! }
}
}
*************** execute_update_addresses_taken (bool do_
*** 1858,1867 ****
if (rhs
&& TREE_CODE (rhs) == MEM_REF
! && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
! && DECL_P (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0))
! && !integer_zerop (TREE_OPERAND (rhs, 1)))
! bitmap_set_bit (not_reg_needs, DECL_UID (TREE_OPERAND (TREE_OPERAND (rhs, 0), 0)));
}
}
}
--- 1863,1877 ----
if (rhs
&& TREE_CODE (rhs) == MEM_REF
! && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR)
! {
! tree decl = TREE_OPERAND (TREE_OPERAND (rhs, 0), 0);
! if (DECL_P (decl)
! && (!integer_zerop (TREE_OPERAND (rhs, 1))
! || (DECL_SIZE (decl)
! != TYPE_SIZE (TREE_TYPE (rhs)))))
! bitmap_set_bit (not_reg_needs, DECL_UID (decl));
! }
}
}
}