summaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 1f32e1f60f9..10bf1ce091c 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -158,11 +158,9 @@ build_addr (tree exp)
{
tree base = exp;
- if (TREE_CODE (base) == REALPART_EXPR || TREE_CODE (base) == IMAGPART_EXPR)
+ while (TREE_CODE (base) == REALPART_EXPR || TREE_CODE (base) == IMAGPART_EXPR
+ || handled_component_p (base))
base = TREE_OPERAND (base, 0);
- else
- while (handled_component_p (base))
- base = TREE_OPERAND (base, 0);
if (DECL_P (base))
TREE_ADDRESSABLE (base) = 1;
@@ -797,7 +795,6 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
}
break;
- case COMPONENT_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
wi->val_only = false;
@@ -805,6 +802,13 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
wi->val_only = true;
break;
+ case COMPONENT_REF:
+ wi->val_only = false;
+ walk_tree (&TREE_OPERAND (t, 0), convert_nonlocal_reference, wi, NULL);
+ wi->val_only = true;
+ walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi, NULL);
+ break;
+
case ARRAY_REF:
case ARRAY_RANGE_REF:
wi->val_only = false;
@@ -932,7 +936,6 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
tsi_link_after (&wi->tsi, x, TSI_SAME_STMT);
break;
- case COMPONENT_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
wi->val_only = false;
@@ -940,6 +943,13 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
wi->val_only = true;
break;
+ case COMPONENT_REF:
+ wi->val_only = false;
+ walk_tree (&TREE_OPERAND (t, 0), convert_local_reference, wi, NULL);
+ wi->val_only = true;
+ walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi, NULL);
+ break;
+
case ARRAY_REF:
case ARRAY_RANGE_REF:
wi->val_only = false;