From bd7fc26f04fc4f8ca9bfc7f5348dae6f67268b7c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 23 Feb 2000 18:29:25 +0000 Subject: [PATCH] Fix arm_comp_type_attributes From-SVN: r32118 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.c | 28 ++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa8f35ed347..24ddde43117 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-02-23 Nick Clifton + + * config/arm/arm.c (arm_comp_type_attributes): Simply and + comment tests on type attributes. + Wed Feb 23 16:42:21 2000 J"orn Rennecke * final.c (shorten_branches): Make value passed to LABEL_ALIGN diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9a5df710148..182bb495860 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1545,7 +1545,10 @@ current_file_function_operand (sym_ref) /* XXX FIXME - we need some way to determine if SYMREF has already been compiled. We wanted to used SYMBOL_REF_FLAG but this is already in use by the constant pool generation code. */ - return sym_ref == XEXP (DECL_RTL (current_function_decl), 0); + return + GET_CODE (sym_ref) == SYMBOL_REF + && sym_ref == XEXP (DECL_RTL (current_function_decl), 0) + && ! DECL_WEAK (current_function_decl); } /* Return non-zero if a 32 bit "long call" should be generated for this @@ -1639,17 +1642,30 @@ arm_comp_type_attributes (type1, type2) tree type2; { int l1, l2, s1, s2; + /* Check for mismatch of non-default calling convention. */ if (TREE_CODE (type1) != FUNCTION_TYPE) return 1; /* Check for mismatched call attributes. */ - l1 = ! lookup_attribute ("long_call", TYPE_ATTRIBUTES (type1)); - l2 = ! lookup_attribute ("long_call", TYPE_ATTRIBUTES (type2)); - s1 = ! lookup_attribute ("short_call", TYPE_ATTRIBUTES (type1)); - s2 = ! lookup_attribute ("short_call", TYPE_ATTRIBUTES (type2)); + l1 = lookup_attribute ("long_call", TYPE_ATTRIBUTES (type1)); + l2 = lookup_attribute ("long_call", TYPE_ATTRIBUTES (type2)); + s1 = lookup_attribute ("short_call", TYPE_ATTRIBUTES (type1)); + s2 = lookup_attribute ("short_call", TYPE_ATTRIBUTES (type2)); - return ! ((l1 ^ l2) || (s1 ^s2) || (l1 | s2) || (s1 | l2)); + /* Only bother to check if an attribute is defined. */ + if (l1 | l2 | s1 | s2) + { + /* If one type has an attribute, the other must have the same attribute. */ + if ((!l1 != !l2) || (!s1 != !s2)) + return 0; + + /* Disallow mixed attributes. */ + if ((l1 & s2) || (l2 & s1)) + return 0; + } + + return 1; }