This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH COMMITTED: Fix rs6000 and spu overload resolution


I managed to break overload resolution for rs6000 and spu, by
introducing two different errors in how the number of arguments was
checked.  Fixed by this patch.  Committed to mainline.

Sorry about the breakage.

Ian


2009-04-21  Ian Lance Taylor  <iant@google.com>

	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Correct test for number of arguments.
	* config/spu/spu-c.c (spu_resolve_overloaded_builtin): Likewise.

Index: config/rs6000/rs6000-c.c
===================================================================
--- config/rs6000/rs6000-c.c	(revision 146451)
+++ config/rs6000/rs6000-c.c	(working copy)
@@ -3241,7 +3241,7 @@ altivec_resolve_overloaded_builtin (tree
 
   /* If the number of arguments did not match the prototype, return NULL
      and the generic code will issue the appropriate error message.  */
-  if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || nargs > 0)
+  if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || n < nargs)
     return NULL;
 
   if (n == 0)
Index: config/spu/spu-c.c
===================================================================
--- config/spu/spu-c.c	(revision 146451)
+++ config/spu/spu-c.c	(working copy)
@@ -132,7 +132,7 @@ spu_resolve_overloaded_builtin (tree fnd
 	{
 	  tree var, arg_type, param_type = TREE_VALUE (param);
 
-	  if (p < nargs)
+	  if (p >= nargs)
 	    {
 	      error ("insufficient arguments to overloaded function %s",
 		     desc->name);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]