aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <Marcus.Meissner@informatik.uni-erlangen.de>1998-10-29 21:37:24 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-29 14:37:24 -0700
commitafcfe58c3860cc80d80c82de080afc1711d8beed (patch)
treeaa45270ca768670b7e536470d37f5cdbf5cabf08
parent1a7a342d99f8faaee26b0c897e48c5b2363a4ae5 (diff)
downloadgcc-afcfe58c3860cc80d80c82de080afc1711d8beed.zip
gcc-afcfe58c3860cc80d80c82de080afc1711d8beed.tar.gz
gcc-afcfe58c3860cc80d80c82de080afc1711d8beed.tar.bz2
i386.c (i386_valid_type_attribute_p): Return nonzero for mismatched "stdcall" and "cdecl" attributes.
* i386.c (i386_valid_type_attribute_p): Return nonzero for mismatched "stdcall" and "cdecl" attributes. From-SVN: r23436
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22c38bc..ee5085d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 70cfcdc..3729553 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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;
}