fold-const.c (fold_binary): Use build_fold_addr_expr for address calculation and INDIRECT_REF handling.

2005-04-27  Richard Guenther  <rguenth@gcc.gnu.org>

	* fold-const.c (fold_binary): Use build_fold_addr_expr
	for address calculation and INDIRECT_REF handling.

From-SVN: r98877
This commit is contained in:
Richard Guenther 2005-04-27 19:39:08 +00:00 committed by Richard Biener
parent 51282ceaf0
commit 49d766869a
2 changed files with 8 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2005-04-27 Richard Guenther <rguenth@gcc.gnu.org>
* fold-const.c (fold_binary): Use build_fold_addr_expr
for address calculation and INDIRECT_REF handling.
2005-04-27 Andrew Haley <aph@redhat.com> 2005-04-27 Andrew Haley <aph@redhat.com>
* postreload-gcse.c (hash_scan_set): Remove bogus assertion. * postreload-gcse.c (hash_scan_set): Remove bogus assertion.

View File

@ -9723,21 +9723,9 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
{ {
tree op0 = TREE_OPERAND (cref0, 0); tree op0 = TREE_OPERAND (cref0, 0);
tree op1 = TREE_OPERAND (cref1, 0); tree op1 = TREE_OPERAND (cref1, 0);
if (TREE_CODE (op0) == INDIRECT_REF) return fold_build2 (code, type,
op0 = TREE_OPERAND (op0, 0); build_fold_addr_expr (op0),
else build_fold_addr_expr (op1));
{
tree ptype = build_pointer_type (TREE_TYPE (op0));
op0 = build1 (ADDR_EXPR, ptype, op0);
}
if (TREE_CODE (op1) == INDIRECT_REF)
op1 = TREE_OPERAND (op1, 0);
else
{
tree ptype = build_pointer_type (TREE_TYPE (op1));
op1 = build1 (ADDR_EXPR, ptype, op1);
}
return fold_build2 (code, type, op0, op1);
} }
} }