From 3345ee7db290b748a5ca92782a863088c735c1fb Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Tue, 4 Mar 1997 21:43:13 +0000 Subject: [PATCH] Make sure FUNDECL is non-nil before we try to use it. From-SVN: r13689 --- gcc/config/i386/i386.c | 2 +- gcc/config/i386/isc.h | 2 +- gcc/config/i386/next.h | 2 +- gcc/config/i386/sco.h | 2 +- gcc/config/i386/sco5.h | 2 +- gcc/config/i386/scodbx.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 85b422fdc22..ff48a3d7a4f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -579,7 +579,7 @@ i386_return_pops_args (fundecl, funtype, size) tree funtype; int size; { - int rtd = TARGET_RTD && TREE_CODE (fundecl) != IDENTIFIER_NODE; + int rtd = TARGET_RTD && (!fundecl || TREE_CODE (fundecl) != IDENTIFIER_NODE); /* Cdecl functions override -mrtd, and never pop the stack */ if (!lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) { diff --git a/gcc/config/i386/isc.h b/gcc/config/i386/isc.h index 24569e1daba..c0a51508abd 100644 --- a/gcc/config/i386/isc.h +++ b/gcc/config/i386/isc.h @@ -37,7 +37,7 @@ #undef RETURN_POPS_ARGS #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - (TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ + ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ : (TARGET_RTD \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ diff --git a/gcc/config/i386/next.h b/gcc/config/i386/next.h index 62c8dd6f25b..8dd46f5cd41 100644 --- a/gcc/config/i386/next.h +++ b/gcc/config/i386/next.h @@ -216,7 +216,7 @@ Boston, MA 02111-1307, USA. */ #undef RETURN_POPS_ARGS #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - (TREE_CODE (FUNDECL) == IDENTIFIER_NODE \ + ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE \ ? 0 \ : (TARGET_RTD \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ diff --git a/gcc/config/i386/sco.h b/gcc/config/i386/sco.h index 8676889f944..9c94a766a83 100644 --- a/gcc/config/i386/sco.h +++ b/gcc/config/i386/sco.h @@ -104,7 +104,7 @@ Boston, MA 02111-1307, USA. */ #undef RETURN_POPS_ARGS #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - (TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ + ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ : (TARGET_RTD \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index d6fc7d4e923..d156cab601e 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -668,7 +668,7 @@ dtors_section () \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ ((TARGET_ELF) ? \ (i386_return_pops_args (FUNDECL, FUNTYPE, SIZE)) : \ - (TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ + (((FUNDECL) && (TREE_CODE (FUNDECL) == IDENTIFIER_NODE)) ? 0 \ : (TARGET_RTD \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h index 3a7a1984c20..a2581d4257f 100644 --- a/gcc/config/i386/scodbx.h +++ b/gcc/config/i386/scodbx.h @@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */ #undef RETURN_POPS_ARGS #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - (TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ + ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ : (TARGET_RTD \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ -- 2.30.2