]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000-c.c (altivec_resolve_overloaded_builtin): Correct test for number of arguments.
authorIan Lance Taylor <iant@google.com>
Tue, 21 Apr 2009 13:59:28 +0000 (13:59 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 21 Apr 2009 13:59:28 +0000 (13:59 +0000)
* 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.

From-SVN: r146526

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/spu/spu-c.c

index 19db0d123ece3a4af4c24f87e87e5dd264956f41..dc53ed377db7c79e668805d336cf31c6b7337203 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2009-04-21  Andreas Schwab  <schwab@linux-m68k.org>
 
        * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Use enum for second
index ebcb11116aa32bf94650c4477788aa61f5e783b2..89e01c2a2ebee514a40016fef026c4f9a1808718 100644 (file)
@@ -3241,7 +3241,7 @@ altivec_resolve_overloaded_builtin (tree fndecl, void *passed_arglist)
 
   /* 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 2ae57ba44c050b16fc28027d52a2c4ddb646648b..6ab7f3bb920bb14d925d010d335a3af84f0c3c5c 100644 (file)
@@ -132,7 +132,7 @@ spu_resolve_overloaded_builtin (tree fndecl, void *passed_args)
        {
          tree var, arg_type, param_type = TREE_VALUE (param);
 
-         if (p < nargs)
+         if (p >= nargs)
            {
              error ("insufficient arguments to overloaded function %s",
                     desc->name);