Fix arm_comp_type_attributes
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2000 18:29:25 +0000 (18:29 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2000 18:29:25 +0000 (18:29 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32118 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index fa8f35e..24ddde4 100644 (file)
@@ -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
index 9a5df71..182bb49 100644 (file)
@@ -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;
 }
 
 \f