diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-06-21 00:59:17 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-06-21 00:59:17 +0000 |
commit | a5eadacc354407939f4bbf55bd44d750e3554344 (patch) | |
tree | 441f3bfca76fbff3165789a7e384227c2ba626ac /gcc/tree-ssa-alias.c | |
parent | 83fbfe42c25f312d47f30be37bcb957c2b7258cf (diff) | |
download | gcc-a5eadacc354407939f4bbf55bd44d750e3554344.zip gcc-a5eadacc354407939f4bbf55bd44d750e3554344.tar.gz gcc-a5eadacc354407939f4bbf55bd44d750e3554344.tar.bz2 |
c-typeck.c (build_function_call): Set fundecl = function again.
2005-06-20 Daniel Berlin <dberlin@dberlin.org>
* c-typeck.c (build_function_call): Set fundecl = function again.
* tree-ssa-alias.c (find_used_portions): Address taking causes the
entire variable to be used.
* tree-ssa-structalias.c (do_structure_copy): Fix handling of
unknown size variables, and structure copies from addressof
operations. Simplify how we do *a = *b type structure copies.
(init_base_vars): Add ANYTHING = &ANYTHING constraint the right
way. READONLY's address is not taken by default.
INTEGER dereference should point to anything.
(create_variable_info_for): It's okay for the first field to not start
at 0.
From-SVN: r101227
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 3098549..04125ca 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3119,6 +3119,35 @@ find_used_portions (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) } } break; + /* This is here to make sure we mark the entire base variable as used + when you take its address. Because our used portion analysis is + simple, we aren't looking at casts or pointer arithmetic to see what + happens when you take the address. */ + case ADDR_EXPR: + { + tree var = get_base_address (TREE_OPERAND (*tp, 0)); + + if (var + && DECL_P (var) + && DECL_SIZE (var) + && var_can_have_subvars (var) + && TREE_CODE (DECL_SIZE (var)) == INTEGER_CST) + { + used_part_t up; + size_t uid = var_ann (var)->uid; + + up = get_or_create_used_part_for (uid); + + up->minused = 0; + up->maxused = TREE_INT_CST_LOW (DECL_SIZE (var)); + up->implicit_uses = true; + + used_portions[uid] = up; + *walk_subtrees = 0; + return NULL_TREE; + } + } + break; case VAR_DECL: case PARM_DECL: { |