diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-12 23:07:53 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-12 23:07:53 +0000 |
commit | 7b346fd91e68676b421cf0112d8d8dcfc9274d3f (patch) | |
tree | c3d33f6377f8775889ac7c774756bf8382becacb /gcc/tree-ssa-operands.c | |
parent | ca67ec1caefd14f541131274ae30fda08fe10192 (diff) | |
download | gcc-7b346fd91e68676b421cf0112d8d8dcfc9274d3f.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109651 138bc75d-0d04-0410-961f-82ee72b054a4
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 24cd3644717..6787dc2dc39 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) { |