diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-03 20:14:18 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-03 20:14:18 +0000 |
commit | 2100c228d42604b982361a4309871b6e1f2c56d7 (patch) | |
tree | 730ad49fb04e92cd040cc6234ab11f52bd71851f /gcc/tree-eh.c | |
parent | 9c65be62147b4e0c07b8cf52a382f01d95613e6e (diff) | |
download | gcc-2100c228d42604b982361a4309871b6e1f2c56d7.tar.gz |
* tree.c (range_in_array_bounds_p): New predicate.
* tree.h (range_in_array_bounds_p): Declare it.
* tree-eh.c (tree_could_trap_p) <ARRAY_RANGE_REF>: Use it to
return a less conservative answer.
* tree-sra.c (struct sra_elt): Add new pointer field 'groups'
and flag 'is_group'.
(IS_ELEMENT_FOR_GROUP): New macro.
(FOR_EACH_ACTUAL_CHILD): Likewise.
(next_child_for_group): New helper function.
(can_completely_scalarize_p): Take into account groups.
(sra_hash_tree): Handle RANGE_EXPR.
(sra_elt_eq): Likewise.
(lookup_element): Be prepared for handling groups.
(is_valid_const_index): Delete.
(maybe_lookup_element_for_expr) <ARRAY_REF>: Use in_array_bounds_p
instead of is_valid_const_index.
<ARRAY_RANGE_REF>: New case.
(sra_walk_expr) <ARRAY_REF>: Use in_array_bounds_p instead of
is_valid_const_index.
<ARRAY_RANGE_REF>: Do not unconditionally punt.
(scan_dump): Dump info for groups too.
(decide_instantiation_1): Likewise.
(decide_block_copy): Assert that the element is not a group.
Propagate decision to groups.
(generate_one_element_ref): Handle RANGE_EXPR.
(mark_no_warning): Iterate over actual childs.
(generate_copy_inout): Likewise.
(generate_element_copy): Likewise.
(generate_element_zero): Likewise.
(generate_element_init_1): Likewise.
(dump_sra_elt_name): Handle RANGE_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115160 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 202073d3534..e3341b1bcb8 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1889,13 +1889,14 @@ tree_could_trap_p (tree expr) goto restart; case ARRAY_RANGE_REF: - /* Let us be conservative here for now. We might be checking bounds of - the access similarly to the case below. */ - if (!TREE_THIS_NOTRAP (expr)) + base = TREE_OPERAND (expr, 0); + if (tree_could_trap_p (base)) return true; - base = TREE_OPERAND (expr, 0); - return tree_could_trap_p (base); + if (TREE_THIS_NOTRAP (expr)) + return false; + + return !range_in_array_bounds_p (expr); case ARRAY_REF: base = TREE_OPERAND (expr, 0); |