diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-15 10:34:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-15 10:34:44 +0000 |
commit | 3fefae7a51f38acf585785f19e5dac4bd01b7172 (patch) | |
tree | 37e6c4df71824b584a70181905ff6a757f809b5f /gcc/tree-ssa-alias.c | |
parent | b1fc8ef135b900872d46ae829c4793a6019792dd (diff) | |
download | gcc-3fefae7a51f38acf585785f19e5dac4bd01b7172.tar.gz |
2005-12-15 Richard Guenther <rguenther@suse.de>
* tree-flow.h (okay_component_ref_for_subvars): Remove.
(get_ref_base_and_extent): Declare.
* tree-dfa.c (okay_component_ref_for_subvars): Remove.
(get_ref_base_and_extent): New function.
* tree-ssa-alias.c (find_used_portions): Use it.
* tree-ssa-structalias.c (get_constraint_for_component_ref):
Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 1a9c0060533..d7d11c11278 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2695,16 +2695,14 @@ find_used_portions (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) case COMPONENT_REF: { HOST_WIDE_INT bitsize; + HOST_WIDE_INT bitmaxsize; HOST_WIDE_INT bitpos; - tree offset; - enum machine_mode mode; - int unsignedp; - int volatilep; tree ref; - ref = get_inner_reference (*tp, &bitsize, &bitpos, &offset, &mode, - &unsignedp, &volatilep, false); - if (DECL_P (ref) && offset == NULL && bitsize != -1) - { + ref = get_ref_base_and_extent (*tp, &bitpos, &bitsize, &bitmaxsize); + if (DECL_P (ref) + && var_can_have_subvars (ref) + && bitmaxsize != -1) + { size_t uid = DECL_UID (ref); used_part_t up; @@ -2712,37 +2710,18 @@ find_used_portions (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) if (bitpos <= up->minused) up->minused = bitpos; - if ((bitpos + bitsize >= up->maxused)) - up->maxused = bitpos + bitsize; + if ((bitpos + bitmaxsize >= up->maxused)) + up->maxused = bitpos + bitmaxsize; - up->explicit_uses = true; + if (bitsize == bitmaxsize) + up->explicit_uses = true; + else + up->implicit_uses = true; up_insert (uid, up); *walk_subtrees = 0; return NULL_TREE; } - else if (DECL_P (ref)) - { - if (DECL_SIZE (ref) - && var_can_have_subvars (ref) - && TREE_CODE (DECL_SIZE (ref)) == INTEGER_CST) - { - used_part_t up; - size_t uid = DECL_UID (ref); - - up = get_or_create_used_part_for (uid); - - up->minused = 0; - up->maxused = TREE_INT_CST_LOW (DECL_SIZE (ref)); - - up->implicit_uses = true; - - up_insert (uid, up); - - *walk_subtrees = 0; - return NULL_TREE; - } - } } break; /* This is here to make sure we mark the entire base variable as used |