diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2004-09-26 10:32:40 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2004-09-26 08:32:40 +0000 |
commit | be35cf60c40ae1c70bb1d1520f66141228d53aa5 (patch) | |
tree | 9fbca781fd14460ac4104a6cc02b07fbb1a75822 /gcc/tree-ssa-loop-im.c | |
parent | 34096b92f493baa7e052bea535c03b90ab12a181 (diff) | |
download | gcc-be35cf60c40ae1c70bb1d1520f66141228d53aa5.zip gcc-be35cf60c40ae1c70bb1d1520f66141228d53aa5.tar.gz gcc-be35cf60c40ae1c70bb1d1520f66141228d53aa5.tar.bz2 |
re PR tree-optimization/17591 (Ada bootstrap SEGV in stage2 on osint.adb, no SEGV when -fno-ivopts)
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.
From-SVN: r88123
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 4aafc81..0330a27 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)) |