From f824e5c36eea7d0a9a5b9a5147751278de4778c0 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 1 Jun 2000 16:18:18 +0000 Subject: 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 --- gcc/c-common.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'gcc/c-common.c') 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; -- cgit v1.1