[lto] Use num_parm_types and nth_parm_type in x86_this_parameter.

Kazu Hirata kazu@codesourcery.com
Sat Jul 29 05:43:00 GMT 2006


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)))



More information about the Gcc-patches mailing list