]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (i386_valid_type_attribute_p): Return nonzero for mismatched "stdcall" and...
authorMarcus Meissner <Marcus.Meissner@informatik.uni-erlangen.de>
Thu, 29 Oct 1998 21:37:24 +0000 (21:37 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 29 Oct 1998 21:37:24 +0000 (14:37 -0700)
        * i386.c (i386_valid_type_attribute_p): Return nonzero for mismatched
        "stdcall" and "cdecl" attributes.

From-SVN: r23436

gcc/ChangeLog
gcc/config/i386/i386.c

index 22c38bc8c115adc0278e0d9ff861890cecc26957..ee5085d024900e34f19a8a7004ed7d162798a1dc 100644 (file)
@@ -1,3 +1,8 @@
+Thu Oct 29 22:30:54 1998  Marcus Meissner <Marcus.Meissner@informatik.uni-erlangen.de>
+
+       * i386.c (i386_valid_type_attribute_p): Return nonzero for mismatched
+       "stdcall" and "cdecl" attributes.
+
 Thu Oct 29 19:05:17 1998  Jim Wilson  <wilson@cygnus.com>
 
        * sched.c (update_flow_info): Add code to ! found_orig_dest case to
index 70cfcdc500b778c1e80be7b3557b58aee74a8d4f..3729553bd2111c7509a8b39784d15e9e2884571a 100644 (file)
@@ -622,9 +622,19 @@ i386_valid_type_attribute_p (type, attributes, identifier, args)
 
 int
 i386_comp_type_attributes (type1, type2)
-     tree type1 ATTRIBUTE_UNUSED;
-     tree type2 ATTRIBUTE_UNUSED;
+     tree type1;
+     tree type2;
 {
+  /* Check for mismatch of non-default calling convention. */
+  char *rtdstr = TARGET_RTD ? "cdecl" : "stdcall";
+
+  if (TREE_CODE (type1) != FUNCTION_TYPE)
+    return 1;
+
+  /* Check for mismatched return types (cdecl vs stdcall).  */
+  if (lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type1))
+      != lookup_attribute (rtdstr, TYPE_ATTRIBUTES (type2)))
+    return 0;
   return 1;
 }