diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-21 19:27:00 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-21 19:27:00 +0000 |
commit | af0ecff34e2b6e3a50642dc00cd2c2e7a7c1523a (patch) | |
tree | fa074c6a524b35099d5e619373b0066febd064c9 /gcc/tree-ssa-loop-im.c | |
parent | a337a40424b4b722262682dd553870403386eaec (diff) | |
download | gcc-af0ecff34e2b6e3a50642dc00cd2c2e7a7c1523a.tar.gz |
2005-03-18 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/20542
* tree-flow-inline.h (overlap_subvar): Move to here.
* tree-ssa-operands.c: From here.
* tree-flow.h (overlap_subvar): Declare.
* tree-ssa-alias.c (add_pointed_to_var): Use overlap_subvar here.
* tree-ssa-loop-im.c (is_call_clobbered_ref): Return proper answer
for variables with subvars.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96829 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 4b695aa98ce..51ada3d8056 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -1146,13 +1146,40 @@ static bool is_call_clobbered_ref (tree ref) { tree base; + HOST_WIDE_INT offset, size; + subvar_t sv; + subvar_t svars; + tree sref = ref; + if (TREE_CODE (sref) == COMPONENT_REF + && (sref = okay_component_ref_for_subvars (sref, &offset, &size))) + { + svars = get_subvars_for_var (sref); + for (sv = svars; sv; sv = sv->next) + { + if (overlap_subvar (offset, size, sv, NULL) + && is_call_clobbered (sv->var)) + return true; + } + } + base = get_base_address (ref); if (!base) return true; if (DECL_P (base)) - return is_call_clobbered (base); + { + if (var_can_have_subvars (base) + && (svars = get_subvars_for_var (base))) + { + for (sv = svars; sv; sv = sv->next) + if (is_call_clobbered (sv->var)) + return true; + return false; + } + else + return is_call_clobbered (base); + } if (INDIRECT_REF_P (base)) { |