From c7a2139bef08cdc8fde38d3d59d88fd2c689e681 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 20 Apr 2007 16:53:37 -0700 Subject: [PATCH] re PR target/31628 (stdcall function is miscompiled) PR target/31628 * config/i386/i386.c (type_has_variadic_args_p): Look for any TREE_LIST with a void_type_node value, not void_list_node exactly. From-SVN: r124014 --- gcc/ChangeLog | 34 ++++++++++++++++++++-------------- gcc/config/i386/i386.c | 13 ++++++++----- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index acab49212b8..f60a91b9ef9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-04-20 Richard Henderson + + PR target/31628 + * config/i386/i386.c (type_has_variadic_args_p): Look for any + TREE_LIST with a void_type_node value, not void_list_node exactly. + 2007-04-21 Douglas Gregor * doc/standards.texi: Re-arrange into language-specific @@ -307,7 +313,7 @@ compilation unit. * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. - (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. This hook indicates if a type is generic. Set it by default to "never generic". * langhooks.h (struct lang_hooks_for_types): Add a new hook @@ -353,7 +359,7 @@ 2007-04-16 Aldy Hernandez - * function.h: Remove sequence_stack extern declaration. + * function.h: Remove sequence_stack extern declaration. 2007-04-16 Kazu Hirata @@ -463,7 +469,7 @@ 2007-04-14 Andrew Pinski PR c/31520 - * c-decl.c (finish_decl): Grab the type of the decl after the call + * c-decl.c (finish_decl): Grab the type of the decl after the call to store_init_value. 2007-04-14 Steven Bosscher @@ -573,7 +579,7 @@ [FLOAT_EXTEND]: Use SSE_FLOAT_MODE_P. 2007-04-12 Paolo Bonzini - Charles Wilson + Charles Wilson * Makefile.in (stamp-as, stamp-collect-ld, stamp-nm): Remove. (libgcc.mvars): Don't depend on them. @@ -1318,16 +1324,16 @@ 2007-04-04 Chen Liqin - * config/score/crti.asm: Change _bss_start to __bss_start. - * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Added. - (OUTGOING_REG_PARM_STACK_SPACE) update. - * config/score/score.opt: add options to make backend support - score5, score5u, score7 and score7d. - * config/score/score.md: Likewise. - * config/score/misc.md: Likewise. - * config/score/mac.md: Likewise. - * doc/invoke.texi: Likewise. - * doc/md.texi: update constraints define. + * config/score/crti.asm: Change _bss_start to __bss_start. + * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Added. + (OUTGOING_REG_PARM_STACK_SPACE) update. + * config/score/score.opt: add options to make backend support + score5, score5u, score7 and score7d. + * config/score/score.md: Likewise. + * config/score/misc.md: Likewise. + * config/score/mac.md: Likewise. + * doc/invoke.texi: Likewise. + * doc/md.texi: update constraints define. 2007-04-03 Richard Henderson diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index cefe8ae7d84..b785f499082 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2895,12 +2895,15 @@ ix86_eax_live_at_start_p (void) static bool type_has_variadic_args_p (tree type) { - tree t; + tree n, t = TYPE_ARG_TYPES (type); - for (t = TYPE_ARG_TYPES (type); t; t = TREE_CHAIN (t)) - if (t == void_list_node) - return false; - return true; + if (t == NULL) + return false; + + while ((n = TREE_CHAIN (t)) != NULL) + t = n; + + return TREE_VALUE (t) != void_type_node; } /* Value is the number of bytes of arguments automatically -- 2.30.2