diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-30 03:52:37 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-30 03:52:37 +0000 |
commit | 1f9b622bb72fbb8256bff4899b2f97cb4c5f5867 (patch) | |
tree | 4b6086cd760db3d4e0eef4da7e0f58d8a24f0d0a /gcc/alias.c | |
parent | 553b7a5dd591a3c394517fb52def0c483b184db8 (diff) | |
download | gcc-1f9b622bb72fbb8256bff4899b2f97cb4c5f5867.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91511 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r-- | gcc/alias.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index dd2f35e502c..3246082af23 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 |