aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStan Cox <coxs@gnu.org>1996-02-29 22:37:10 +0000
committerStan Cox <coxs@gnu.org>1996-02-29 22:37:10 +0000
commit698cdd84d5f3e7436900fce56844198820c75023 (patch)
treecbc8acff0958f385899eac77b8a3503d68d32537 /gcc
parent4d46c3cec6dd153af7237fa518a7d1cc109404f8 (diff)
downloadgcc-698cdd84d5f3e7436900fce56844198820c75023.zip
gcc-698cdd84d5f3e7436900fce56844198820c75023.tar.gz
gcc-698cdd84d5f3e7436900fce56844198820c75023.tar.bz2
(i386_return_pops_args): Cleanup extra argument
From-SVN: r11389
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 212c67b..50a8211 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -460,31 +460,30 @@ i386_return_pops_args (fundecl, funtype, size)
tree fundecl;
tree funtype;
int size;
-{
+{
int rtd = TARGET_RTD;
if (TREE_CODE (funtype) == IDENTIFIER_NODE)
return 0;
- /* Cdecl functions override -mrtd, and never pop the stack */
- if (lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype)))
+ /* Cdecl functions override -mrtd, and never pop the stack */
+ if (!lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {
+
+ /* Stdcall functions will pop the stack if not variable args */
+ if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype)))
+ rtd = 1;
+
+ if (rtd
+ && (TYPE_ARG_TYPES (funtype) == NULL_TREE
+ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (funtype))) == void_type_node)))
+ return size;
+ }
+
+ /* Lose any fake structure return argument */
+ if (aggregate_value_p (TREE_TYPE (funtype)))
+ return GET_MODE_SIZE (Pmode);
+
return 0;
-
- /* Stdcall functions will pop the stack if not variable args */
- if (lookup_attribute ("stdcall", TYPE_ATTRIBUTES (funtype)))
- rtd = 1;
-
- if (rtd)
- {
- if (TYPE_ARG_TYPES (funtype) == NULL_TREE
- || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (funtype))) == void_type_node))
- return size;
-
- if (aggregate_value_p (TREE_TYPE (funtype)))
- return GET_MODE_SIZE (Pmode);
- }
-
- return 0;
}