diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-06-01 16:18:18 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-06-01 12:18:18 -0400 |
commit | f824e5c36eea7d0a9a5b9a5147751278de4778c0 (patch) | |
tree | 9c9aade5f3fbb3ff2540e194718e4cecd3846365 /gcc/c-common.c | |
parent | 611a4b873e1fbd6fc2b4a28c05924660a0b5c2af (diff) | |
download | gcc-f824e5c36eea7d0a9a5b9a5147751278de4778c0.zip gcc-f824e5c36eea7d0a9a5b9a5147751278de4778c0.tar.gz gcc-f824e5c36eea7d0a9a5b9a5147751278de4778c0.tar.bz2 |
alias.c (get_alias_set): Don't call language-specific routine more than is needed and clean up code a bit.
* alias.c (get_alias_set): Don't call language-specific routine more
than is needed and clean up code a bit.
* c-common.c (c_get_alias_set): All references whose type
is char get alias set 0, but character types need not.
* varasm.c (make_function_rtl): Don't call set_mem_attributes.
(make_decl_rtl): Don't call it for FUNCTION_DECL.
From-SVN: r34341
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 5cc34c9..0ba6873 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3284,33 +3284,22 @@ c_get_alias_set (t) return 0; /* If this is a char *, the ANSI C standard says it can alias - anything. */ - else if (TREE_CODE (t) == INDIRECT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == INTEGER_TYPE - && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (t, 0))) - == TYPE_PRECISION (char_type_node))) + anything. Note that all references need do this. */ + if (TREE_CODE_CLASS (TREE_CODE (t)) == 'r' + && TREE_CODE (TREE_TYPE (t)) == INTEGER_TYPE + && TYPE_PRECISION (TREE_TYPE (t)) == TYPE_PRECISION (char_type_node)) return 0; /* That's all the expressions we handle specially. */ if (! TYPE_P (t)) return -1; - if (TREE_CODE (t) == INTEGER_TYPE) - { - /* The C standard specifically allows aliasing between signed and - unsigned variants of the same type. We treat the signed - variant as canonical. */ - tree signed_variant = signed_type (t); - - if (signed_variant == signed_char_type_node) - /* The C standard guarantess that any object may be accessed - via an lvalue that has character type. We don't have to - check for unsigned_char_type_node or char_type_node because - we are specifically looking at the signed variant. */ - return 0; - else if (signed_variant != t) - return get_alias_set (signed_variant); - } + /* The C standard specifically allows aliasing between signed and + unsigned variants of the same type. We treat the signed + variant as canonical. */ + if (TREE_CODE (t) == INTEGER_TYPE && TREE_UNSIGNED (t)) + return get_alias_set (signed_type (t)); + else if (POINTER_TYPE_P (t)) { tree t1; |