diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-26 08:32:40 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-26 08:32:40 +0000 |
commit | a59824bb9fa450de7be79e73553d726338ed2669 (patch) | |
tree | 9fbca781fd14460ac4104a6cc02b07fbb1a75822 /gcc/tree-ssa-loop-im.c | |
parent | 4cf22dc69cc5cad4300cb5a39f7e74c76a16919d (diff) | |
download | gcc-a59824bb9fa450de7be79e73553d726338ed2669.tar.gz |
PR bootstrap/17591
* tree-ssa-loop-im.c (for_each_index): Call callback for component_refs
with varying offset.
* tree-ssa-loop-ivopts.c (abnormal_ssa_name_p): New function.
(idx_contains_abnormal_ssa_name_p): Scan step and lower bound for
ARRAY_REFS.
(expr_invariant_in_loop_p): New function.
(idx_find_step): Handle step and lower bound for ARRAY_REFs. Handle
component_ref_field_offset for COMPONENT_REFs. Do not allow
ALIGN_INDIRECT_REFs and MISALIGNED_INDIRECT_REFs.
(add_address_candidates): Do not handle ALIGN_INDIRECT_REFs and
MISALIGNED_INDIRECT_REFs.
(idx_remove_ssa_names): Handle step and lower bound for ARRAY_REFs.
(rewrite_address_base): Do not handle ALIGN_INDIRECT_REFs and
MISALIGNED_INDIRECT_REFs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88123 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 4aafc815b84..0330a278009 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -128,7 +128,7 @@ get_stmt_uid (tree stmt) bool for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data) { - tree *nxt; + tree *nxt, *idx; for (; ; addr_p = nxt) { @@ -144,7 +144,6 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data) return cbck (*addr_p, nxt, data); case BIT_FIELD_REF: - case COMPONENT_REF: case VIEW_CONVERT_EXPR: case ARRAY_RANGE_REF: case REALPART_EXPR: @@ -152,6 +151,17 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data) nxt = &TREE_OPERAND (*addr_p, 0); break; + case COMPONENT_REF: + /* If the component has varying offset, it behaves like index + as well. */ + idx = &TREE_OPERAND (*addr_p, 2); + if (*idx + && !cbck (*addr_p, idx, data)) + return false; + + nxt = &TREE_OPERAND (*addr_p, 0); + break; + case ARRAY_REF: nxt = &TREE_OPERAND (*addr_p, 0); if (!cbck (*addr_p, &TREE_OPERAND (*addr_p, 1), data)) |