aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-06-25 01:28:34 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-06-24 21:28:34 -0400
commit0c3b8d135d94e03d34a137a13857436be536ac66 (patch)
tree49657bf2149002ba15ce92b56d3b866765300899 /gcc
parent61a36b9baaae66daf5ba883a86d4c0886256b05f (diff)
downloadgcc-0c3b8d135d94e03d34a137a13857436be536ac66.zip
gcc-0c3b8d135d94e03d34a137a13857436be536ac66.tar.gz
gcc-0c3b8d135d94e03d34a137a13857436be536ac66.tar.bz2
fold-const.c (fold_addr_expr_with_type): Look through all valid LHS modifiers to find a base to mark addressable.
* fold-const.c (fold_addr_expr_with_type): Look through all valid LHS modifiers to find a base to mark addressable. From-SVN: r83628
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/fold-const.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8646991..e4f9cb1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2004-06-24 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * fold-const.c (fold_addr_expr_with_type): Look through all
+ valid LHS modifiers to find a base to mark addressable.
+
* tree.h (debug_find_tree): Add declaration.
* tree-inline.c (debug_find_tree): Remove extern declaration.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6ef7b1a..343662a 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10420,8 +10420,10 @@ build_fold_addr_expr_with_type (tree t, tree ptrtype)
else
{
tree base = t;
- while (TREE_CODE (base) == COMPONENT_REF
- || TREE_CODE (base) == ARRAY_REF)
+
+ while (handled_component_p (base)
+ || TREE_CODE (base) == REALPART_EXPR
+ || TREE_CODE (base) == IMAGPART_EXPR)
base = TREE_OPERAND (base, 0);
if (DECL_P (base))
TREE_ADDRESSABLE (base) = 1;