+2016-06-09 Martin Sebor <msebor@redhat.com>
+
+ PR c/70883
+ * c-common.c (builtin_function_validate_nargs): Make text of error
+ message consistent with others like it.
+
2016-06-08 Martin Sebor <msebor@redhat.com>
Jakub Jelinek <jakub@redhat.com>
{
if (nargs < required)
{
- error_at (loc, "not enough arguments to function %qE", fndecl);
+ error_at (loc, "too few arguments to function %qE", fndecl);
return false;
}
else if (nargs > required)
+2016-06-09 Martin Sebor <msebor@redhat.com>
+
+ PR c/70883
+ * c-c++-common/builtin-arith-overflow-1.c: Adjust diagnostic text.
+ * gcc.dg/builtin-constant_p-1.c: Same.
+ * gcc.dg/builtins-error.c: Same.
+ * gcc.dg/pr70859.c: Same.
+
2016-06-09 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.c-torture/execute/bswap-2.c: Require int32plus.
int
f1 (void)
{
- int x = __builtin_add_overflow (); /* { dg-error "not enough arguments to function" } */
- x += __builtin_sub_overflow (); /* { dg-error "not enough arguments to function" } */
- x += __builtin_mul_overflow (); /* { dg-error "not enough arguments to function" } */
- x += __builtin_add_overflow_p (); /* { dg-error "not enough arguments to function" } */
- x += __builtin_sub_overflow_p (); /* { dg-error "not enough arguments to function" } */
- x += __builtin_mul_overflow_p (); /* { dg-error "not enough arguments to function" } */
+ int x = __builtin_add_overflow (); /* { dg-error "too few arguments to function" } */
+ x += __builtin_sub_overflow (); /* { dg-error "too few arguments to function" } */
+ x += __builtin_mul_overflow (); /* { dg-error "too few arguments to function" } */
+ x += __builtin_add_overflow_p (); /* { dg-error "too few arguments to function" } */
+ x += __builtin_sub_overflow_p (); /* { dg-error "too few arguments to function" } */
+ x += __builtin_mul_overflow_p (); /* { dg-error "too few arguments to function" } */
return x;
}
x += __builtin_add_overflow_p (a, b, d, d); /* { dg-error "too many arguments to function" } */
x += __builtin_sub_overflow_p (a, b, d, d, 1, d); /* { dg-error "too many arguments to function" } */
x += __builtin_mul_overflow_p (a, b, d, d); /* { dg-error "too many arguments to function" } */
-
+
return x;
}
int main()
{
- if (__builtin_constant_p ()) /* { dg-error "not enough" } */
+ if (__builtin_constant_p ()) /* { dg-error "too few arguments" } */
return 0;
- if (__builtin_constant_p (5, 6)) /* { dg-error "too many" } */
+ if (__builtin_constant_p (5, 6)) /* { dg-error "too many arguments" } */
return 1;
return 0;
}
int test2(double x)
{
- if (x == 1) return __builtin_fpclassify(1,2,3,4,5); /* { dg-error "not enough arguments" } */
- if (x == 2) return __builtin_isfinite(); /* { dg-error "not enough arguments" } */
- if (x == 3) return __builtin_isinf_sign(); /* { dg-error "not enough arguments" } */
- if (x == 4) return __builtin_isinf(); /* { dg-error "not enough arguments" } */
- if (x == 5) return __builtin_isnan(); /* { dg-error "not enough arguments" } */
- if (x == 6) return __builtin_isnormal(); /* { dg-error "not enough arguments" } */
- if (x == 7) return __builtin_isgreater(x); /* { dg-error "not enough arguments" } */
- if (x == 8) return __builtin_isgreaterequal(x); /* { dg-error "not enough arguments" } */
- if (x == 9) return __builtin_isless(x); /* { dg-error "not enough arguments" } */
- if (x == 10) return __builtin_islessequal(x); /* { dg-error "not enough arguments" } */
- if (x == 11) return __builtin_islessgreater(x); /* { dg-error "not enough arguments" } */
- if (x == 12) return __builtin_isunordered(x); /* { dg-error "not enough arguments" } */
- if (x == 13) return __builtin_signbit(); /* { dg-error "not enough arguments" } */
+ if (x == 1) return __builtin_fpclassify(1,2,3,4,5); /* { dg-error "too few arguments" } */
+ if (x == 2) return __builtin_isfinite(); /* { dg-error "too few arguments" } */
+ if (x == 3) return __builtin_isinf_sign(); /* { dg-error "too few arguments" } */
+ if (x == 4) return __builtin_isinf(); /* { dg-error "too few arguments" } */
+ if (x == 5) return __builtin_isnan(); /* { dg-error "too few arguments" } */
+ if (x == 6) return __builtin_isnormal(); /* { dg-error "too few arguments" } */
+ if (x == 7) return __builtin_isgreater(x); /* { dg-error "too few arguments" } */
+ if (x == 8) return __builtin_isgreaterequal(x); /* { dg-error "too few arguments" } */
+ if (x == 9) return __builtin_isless(x); /* { dg-error "too few arguments" } */
+ if (x == 10) return __builtin_islessequal(x); /* { dg-error "too few arguments" } */
+ if (x == 11) return __builtin_islessgreater(x); /* { dg-error "too few arguments" } */
+ if (x == 12) return __builtin_isunordered(x); /* { dg-error "too few arguments" } */
+ if (x == 13) return __builtin_signbit(); /* { dg-error "too few arguments" } */
return 0;
}
int
fn1 (void)
{
- if (__builtin_constant_p ()) /* { dg-error "7:not enough" } */
+ if (__builtin_constant_p ()) /* { dg-error "7:too few" } */
return 0;
if (__builtin_constant_p (1, 2)) /* { dg-error "7:too many" } */
return 1;
- if (__builtin_isfinite ()) /* { dg-error "7:not enough" } */
+ if (__builtin_isfinite ()) /* { dg-error "7:too few" } */
return 3;
if (__builtin_isfinite (1, 2)) /* { dg-error "7:too many" } */
return 4;
- if (__builtin_isless (0)) /* { dg-error "7:not enough" } */
+ if (__builtin_isless (0)) /* { dg-error "7:too few" } */
return 5;
if (__builtin_isless (1, 2, 3)) /* { dg-error "7:too many" } */
return 6;
- if (__builtin_fpclassify (1, 2, 3, 4, 5)) /* { dg-error "7:not enough" } */
+ if (__builtin_fpclassify (1, 2, 3, 4, 5)) /* { dg-error "7:too few" } */
return 7;
if (__builtin_fpclassify (1, 2, 3, 4, 5, r, 6)) /* { dg-error "7:too many" } */
return 8;
return 9;
if (__builtin_assume_aligned (p, r, p, p)) /* { dg-error "7:too many" } */
return 10;
- if (__builtin_add_overflow ()) /* { dg-error "7:not enough" } */
+ if (__builtin_add_overflow ()) /* { dg-error "7:too few" } */
return 11;
if (__builtin_add_overflow (1, 2, 3, &r)) /* { dg-error "7:too many" } */
return 12;