fold-const.c (fold_addr_expr_with_type): Look through all valid LHS modifiers to...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Fri, 25 Jun 2004 01:28:34 +0000 (01:28 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 25 Jun 2004 01:28:34 +0000 (21:28 -0400)
* fold-const.c (fold_addr_expr_with_type): Look through all
valid LHS modifiers to find a base to mark addressable.

From-SVN: r83628

gcc/ChangeLog
gcc/fold-const.c

index 86469913bc9e7dc789bdd187160af1474f3affc4..e4f9cb1dc00334b097ff0182d1fcd9b5d5c41242 100644 (file)
@@ -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.
 
index 6ef7b1a953219fdac4800c8e7232764c672f1653..343662a5ee9a8952408f561969d16e949be71a26 100644 (file)
@@ -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;