diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-05-18 13:26:20 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-05-18 13:26:20 +0000 |
commit | 23e66a36cb937636be796fce2f7d273209a80a4f (patch) | |
tree | 1daf09adb4495e7e47c5327a576a83c392ac1029 /gcc/tree-ssa-operands.c | |
parent | 01063d48ed40614f1faad8c74207a2d64b1ab255 (diff) | |
download | gcc-23e66a36cb937636be796fce2f7d273209a80a4f.zip gcc-23e66a36cb937636be796fce2f7d273209a80a4f.tar.gz gcc-23e66a36cb937636be796fce2f7d273209a80a4f.tar.bz2 |
re PR tree-optimization/21407 (wrong code with downcast in C++)
2005-05-18 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/21407
* tree-ssa-operands.c (note_addressable): Change
COMPONENT_REF handling in response to aliasing
discussion.
From-SVN: r99896
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index ccc2033..e43b603 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1886,35 +1886,14 @@ add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags) static void note_addressable (tree var, stmt_ann_t s_ann) { - tree ref; subvar_t svars; - HOST_WIDE_INT offset; - HOST_WIDE_INT size; if (!s_ann) return; - /* If this is a COMPONENT_REF, and we know exactly what it touches, we only - take the address of the subvariables it will touch. - Otherwise, we take the address of all the subvariables, plus the real - ones. */ - - if (var && TREE_CODE (var) == COMPONENT_REF - && (ref = okay_component_ref_for_subvars (var, &offset, &size))) - { - subvar_t sv; - svars = get_subvars_for_var (ref); - - if (s_ann->addresses_taken == NULL) - s_ann->addresses_taken = BITMAP_GGC_ALLOC (); - - for (sv = svars; sv; sv = sv->next) - { - if (overlap_subvar (offset, size, sv, NULL)) - bitmap_set_bit (s_ann->addresses_taken, var_ann (sv->var)->uid); - } - return; - } + /* Note that it is *NOT OKAY* to use the target of a COMPONENT_REF + as the only thing we take the address of. + See PR 21407 and the ensuing mailing list discussion. */ var = get_base_address (var); if (var && SSA_VAR_P (var)) |