This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Use num_parm_types and nth_parm_type in x86_this_parameter.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jul 2006 20:04:29 -0700
- Subject: [lto] Use num_parm_types and nth_parm_type in x86_this_parameter.
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-29 Kazu Hirata <kazu@codesourcery.com>
* config/i386/i386.c (x86_this_parameter): Use num_parm_types
and nth_parm_type in x86_this_parameter.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 115762)
+++ config/i386/i386.c (working copy)
@@ -17259,10 +17259,11 @@ x86_this_parameter (tree function)
if (ix86_function_regparm (type, function) > 0)
{
tree arg_types = TYPE_ARG_TYPES (type);
+ int len = num_parm_types (arg_types);
/* If the function does not have a variable number of arguments,
then the this parameter is in the first argument. */
- if (arg_types && TREE_VALUE (tree_last (arg_types)) == void_type_node)
+ if (arg_types && nth_parm_type (arg_types, len - 1) == void_type_node)
{
int regno = 0;
if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type)))