summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-27 19:39:08 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-27 19:39:08 +0000
commit95b0d8d06578b6c87c840bac2d9a85b5df15ecb6 (patch)
tree202d8b6c9f1bd1043f1f9636ea19700aab9ad147
parent3b38d53e4ddb3afc13c54bcb901e7d7677a34351 (diff)
downloadgcc-95b0d8d06578b6c87c840bac2d9a85b5df15ecb6.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98877 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c18
2 files changed, 8 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index af1b5fd1626..4d31978f1bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
* postreload-gcse.c (hash_scan_set): Remove bogus assertion.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 9de988c2300..9e9243cdaae 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -9723,21 +9723,9 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
{
tree op0 = TREE_OPERAND (cref0, 0);
tree op1 = TREE_OPERAND (cref1, 0);
- if (TREE_CODE (op0) == INDIRECT_REF)
- op0 = TREE_OPERAND (op0, 0);
- else
- {
- 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);
+ return fold_build2 (code, type,
+ build_fold_addr_expr (op0),
+ build_fold_addr_expr (op1));
}
}