aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>2000-02-23 18:29:25 +0000
committerNick Clifton <nickc@gcc.gnu.org>2000-02-23 18:29:25 +0000
commitbd7fc26f04fc4f8ca9bfc7f5348dae6f67268b7c (patch)
treeca9e54e2b84f9f33484dbb0701c4cc390de07885 /gcc
parent8bacb3d9672f52aff9464d9d534c30818e3da8fc (diff)
downloadgcc-bd7fc26f04fc4f8ca9bfc7f5348dae6f67268b7c.zip
gcc-bd7fc26f04fc4f8ca9bfc7f5348dae6f67268b7c.tar.gz
gcc-bd7fc26f04fc4f8ca9bfc7f5348dae6f67268b7c.tar.bz2
Fix arm_comp_type_attributes
From-SVN: r32118
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arm/arm.c28
2 files changed, 27 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fa8f35e..24ddde4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-02-23 Nick Clifton <nickc@cygnus.com>
+
+ * 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 <amylaar@cygnus.co.uk>
* 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 9a5df71..182bb49 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));
+
+ /* 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;
- return ! ((l1 ^ l2) || (s1 ^s2) || (l1 | s2) || (s1 | l2));
+ /* Disallow mixed attributes. */
+ if ((l1 & s2) || (l2 & s1))
+ return 0;
+ }
+
+ return 1;
}