diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2006-01-12 23:07:53 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2006-01-12 23:07:53 +0000 |
commit | dff852300d9b22630a068004ba5392cd5da0e523 (patch) | |
tree | c3d33f6377f8775889ac7c774756bf8382becacb /gcc/tree-ssa-operands.c | |
parent | 1cd99a23170ba575038abfd96bd0694e363e944c (diff) | |
download | gcc-dff852300d9b22630a068004ba5392cd5da0e523.zip gcc-dff852300d9b22630a068004ba5392cd5da0e523.tar.gz gcc-dff852300d9b22630a068004ba5392cd5da0e523.tar.bz2 |
tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR to try to avoid clobbering pieces of structures when...
2006-01-11 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-operands.c (add_call_clobber_ops): Use SFT_PARENT_VAR
to try to avoid clobbering pieces of structures when we know
something about the whole structure.
* tree-ssa-alias.c (create_sft): Set SFT_PARENT_VAR
From-SVN: r109651
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 24cd364..6787dc2 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1778,14 +1778,25 @@ add_call_clobber_ops (tree stmt, tree callee) EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, u, bi) { tree var = referenced_var (u); + unsigned int uid = u; + if (unmodifiable_var_p (var)) add_stmt_operand (&var, &empty_ann, opf_none); else { - bool not_read - = not_read_b ? bitmap_bit_p (not_read_b, u) : false; - bool not_written - = not_written_b ? bitmap_bit_p (not_written_b, u) : false; + bool not_read; + bool not_written; + + /* Not read and not written are computed on regular vars, not + subvars, so look at the parent var if this is an SFT. */ + + if (TREE_CODE (var) == STRUCT_FIELD_TAG) + uid = DECL_UID (SFT_PARENT_VAR (var)); + + not_read = + not_read_b ? bitmap_bit_p (not_read_b, uid) : false; + not_written = + not_written_b ? bitmap_bit_p (not_written_b, uid) : false; if (not_written) { |