summaryrefslogtreecommitdiff
path: root/gcc/tree-alias-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-alias-common.c')
-rw-r--r--gcc/tree-alias-common.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree-alias-common.c b/gcc/tree-alias-common.c
index 33ef6d34db3..561feb5210a 100644
--- a/gcc/tree-alias-common.c
+++ b/gcc/tree-alias-common.c
@@ -207,12 +207,15 @@ get_alias_var (tree expr)
switch (TREE_CODE (expr))
{
case ARRAY_REF:
+ case ARRAY_RANGE_REF:
{
- /* Find the first non-array ref, and return it's alias
- variable */
+ /* Find the first non-array ref, and return its alias variable. */
tree p;
- for (p = expr; TREE_CODE (p) == ARRAY_REF;
- p = TREE_OPERAND (p, 0));
+
+ for (p = expr;
+ TREE_CODE (p) == ARRAY_REF || TREE_CODE (p) == ARRAY_RANGE_REF;
+ p = TREE_OPERAND (p, 0))
+ ;
return get_alias_var (p);
}
break;