diff options
author | Richard Guenther <rguenther@suse.de> | 2006-01-14 14:30:33 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2006-01-14 14:30:33 +0000 |
commit | a916f21d3c176a23f54114a17605813a31cd5d2e (patch) | |
tree | 97912e34de2d72cef706a4b2d7ff6e7a163b3439 /gcc/tree-ssa-operands.c | |
parent | 7f17528ab58fa0a0f627b94bacbae686438b9bd4 (diff) | |
download | gcc-a916f21d3c176a23f54114a17605813a31cd5d2e.zip gcc-a916f21d3c176a23f54114a17605813a31cd5d2e.tar.gz gcc-a916f21d3c176a23f54114a17605813a31cd5d2e.tar.bz2 |
re PR tree-optimization/22548 (Aliasing can not tell array members apart)
2006-01-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/22548
PR tree-optimization/22555
PR tree-optimization/22501
* Makefile.in (tree-ssa-structalias.o): Depend on $(PARAMS_H).
* params.def (salias-max-array-elements): New parameter.
* params.h (SALIAS_MAX_ARRAY_ELEMENTS): Define.
* doc/invoke.texi (salias-max-array-elements): Document.
* tree-flow-inline.h (var_can_have_subvars): We also handle
arrays now.
* tree-ssa-alias.c (find_used_portions): Handle ARRAY_REF like
COMPONENT_REF.
* tree-ssa-structalias.c (params.h): Include.
(push_fields_onto_fieldstack): Handle ARRAY_TYPE.
(find_func_aliases): Handle multiple constraints from ARRAY_REF.
(get_constraint_for): For ADDR_EXPR operating on something
containing an ARRAY_REF, add all subvars to the solution.
(handle_ptr_arith): Handle ARRAY_TYPE like RECORD_TYPE types.
* tree-ssa-operands.c (parse_ssa_operands): Handle ARRAY_REF
for creating MUST_DEFs.
(get_expr_operands): Treat ARRAY_REF like COMPONENT_REF wrt subvars.
* gcc.dg/tree-ssa/alias-4.c: New testcase.
* gcc.dg/tree-ssa/alias-5.c: Likewise.
* gcc.dg/tree-ssa/alias-6.c: Likewise.
* gcc.dg/tree-ssa/alias-7.c: Likewise.
* gcc.dg/tree-ssa/alias-8.c: Likewise.
* gcc.dg/tree-ssa/alias-9.c: Likewise.
* gcc.dg/tree-ssa/alias-10.c: Likewise.
* gcc.dg/tree-ssa/alias-11.c: Likewise.
* gcc.dg/tree-ssa/alias-12.c: Likewise.
From-SVN: r109703
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 6787dc2..87a1fc6 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -732,8 +732,7 @@ parse_ssa_operands (tree stmt) if (TREE_CODE (lhs) == VIEW_CONVERT_EXPR) lhs = TREE_OPERAND (lhs, 0); - if (TREE_CODE (lhs) != ARRAY_REF - && TREE_CODE (lhs) != ARRAY_RANGE_REF + if (TREE_CODE (lhs) != ARRAY_RANGE_REF && TREE_CODE (lhs) != BIT_FIELD_REF) lhs_flags |= opf_kill_def; @@ -1101,7 +1100,6 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) get_tmr_operands (stmt, expr, flags); return; - case ARRAY_REF: case ARRAY_RANGE_REF: /* Treat array references as references to the virtual variable representing the array. The virtual variable for an ARRAY_REF @@ -1115,6 +1113,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) get_expr_operands (stmt, &TREE_OPERAND (expr, 3), opf_none); return; + case ARRAY_REF: case COMPONENT_REF: case REALPART_EXPR: case IMAGPART_EXPR: @@ -1162,6 +1161,12 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) s_ann->has_volatile_ops = true; get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none); } + else if (code == ARRAY_REF) + { + get_expr_operands (stmt, &TREE_OPERAND (expr, 1), opf_none); + get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none); + get_expr_operands (stmt, &TREE_OPERAND (expr, 3), opf_none); + } return; } case WITH_SIZE_EXPR: @@ -1192,8 +1197,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) op = TREE_OPERAND (expr, 0); if (TREE_CODE (op) == WITH_SIZE_EXPR) op = TREE_OPERAND (expr, 0); - if (TREE_CODE (op) == ARRAY_REF - || TREE_CODE (op) == ARRAY_RANGE_REF + if (TREE_CODE (op) == ARRAY_RANGE_REF || TREE_CODE (op) == REALPART_EXPR || TREE_CODE (op) == IMAGPART_EXPR) subflags = opf_is_def; |