aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-11-29 19:52:37 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-11-29 19:52:37 -0800
commitafe849213eed9764b4579ba081c111a0b3ddde25 (patch)
tree4b6086cd760db3d4e0eef4da7e0f58d8a24f0d0a /gcc/alias.c
parentf2978871b26c69d516916d280e81cc1f9b460416 (diff)
downloadgcc-afe849213eed9764b4579ba081c111a0b3ddde25.zip
gcc-afe849213eed9764b4579ba081c111a0b3ddde25.tar.gz
gcc-afe849213eed9764b4579ba081c111a0b3ddde25.tar.bz2
expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR.
* expr.c (get_inner_reference): Handle REAL/IMAGPART_EXPR. (handled_component_p): Likewise. * alias.c (can_address_p): Reformat and simplify. Handle REAL/IMAGPART_EXPR. Do not disable addressability based on alias set zero. * fold-const.c (build_fold_addr_expr_with_type): Remove duplicate check for REAL/IMAGPART_EXPR. * gimplify.c (gimplify_compound_lval): Likewise. * tree-cfg.c (verify_expr): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-nested.c (build_addr, convert_nonlocal_reference): Likewise. (convert_local_reference): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Likewise. From-SVN: r91511
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index dd2f35e..3246082 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -384,30 +384,36 @@ find_base_decl (tree t)
int
can_address_p (tree t)
{
- /* If we're at the end, it is vacuously addressable. */
- if (! handled_component_p (t))
- return 1;
+ while (1)
+ {
+ /* If we're at the end, it is vacuously addressable. */
+ if (!handled_component_p (t))
+ return true;
- /* Bitfields are never addressable. */
- else if (TREE_CODE (t) == BIT_FIELD_REF)
- return 0;
+ switch (TREE_CODE (t))
+ {
+ case COMPONENT_REF:
+ if (DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1)))
+ return false;
+ break;
- /* Fields are addressable unless they are marked as nonaddressable or
- the containing type has alias set 0. */
- else if (TREE_CODE (t) == COMPONENT_REF
- && ! DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1))
- && get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) != 0
- && can_address_p (TREE_OPERAND (t, 0)))
- return 1;
+ case ARRAY_REF:
+ case ARRAY_RANGE_REF:
+ if (TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (t, 0))))
+ return false;
+ break;
- /* Likewise for arrays. */
- else if ((TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
- && ! TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (t, 0)))
- && get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) != 0
- && can_address_p (TREE_OPERAND (t, 0)))
- return 1;
+ case REALPART_EXPR:
+ case IMAGPART_EXPR:
+ break;
- return 0;
+ default:
+ /* Bitfields and casts are never addressable. */
+ return false;
+ }
+
+ t = TREE_OPERAND (t, 0);
+ }
}
/* Return the alias set for T, which may be either a type or an