Commit 3345ee7d by Stan Cox

Make sure FUNDECL is non-nil before we try to use it.

From-SVN: r13689
parent b0298aa6
...@@ -579,7 +579,7 @@ i386_return_pops_args (fundecl, funtype, size) ...@@ -579,7 +579,7 @@ i386_return_pops_args (fundecl, funtype, size)
tree funtype; tree funtype;
int size; 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 */ /* Cdecl functions override -mrtd, and never pop the stack */
if (!lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) { if (!lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#undef RETURN_POPS_ARGS #undef RETURN_POPS_ARGS
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
(TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
: (TARGET_RTD \ : (TARGET_RTD \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
......
...@@ -216,7 +216,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -216,7 +216,7 @@ Boston, MA 02111-1307, USA. */
#undef RETURN_POPS_ARGS #undef RETURN_POPS_ARGS
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
(TREE_CODE (FUNDECL) == IDENTIFIER_NODE \ ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE \
? 0 \ ? 0 \
: (TARGET_RTD \ : (TARGET_RTD \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
......
...@@ -104,7 +104,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -104,7 +104,7 @@ Boston, MA 02111-1307, USA. */
#undef RETURN_POPS_ARGS #undef RETURN_POPS_ARGS
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
(TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
: (TARGET_RTD \ : (TARGET_RTD \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
......
...@@ -668,7 +668,7 @@ dtors_section () \ ...@@ -668,7 +668,7 @@ dtors_section () \
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
((TARGET_ELF) ? \ ((TARGET_ELF) ? \
(i386_return_pops_args (FUNDECL, FUNTYPE, SIZE)) : \ (i386_return_pops_args (FUNDECL, FUNTYPE, SIZE)) : \
(TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ (((FUNDECL) && (TREE_CODE (FUNDECL) == IDENTIFIER_NODE)) ? 0 \
: (TARGET_RTD \ : (TARGET_RTD \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
......
...@@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */
#undef RETURN_POPS_ARGS #undef RETURN_POPS_ARGS
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
(TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
: (TARGET_RTD \ : (TARGET_RTD \
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \ && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment