Commit 40b97a2e by Joseph Myers Committed by Joseph Myers

builtins.c, [...]: Say "argument" instead of "arg" in diagnostics.

	* builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument"
	instead of "arg" in diagnostics.

testsuite:
	* gcc.dg/builtin-prefetch-1.c: Update expected diagnostic.

From-SVN: r90338
parent 9e637a26
2004-11-09 Joseph S. Myers <joseph@codesourcery.com> 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument"
instead of "arg" in diagnostics.
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c,
gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c,
......
...@@ -922,28 +922,29 @@ expand_builtin_prefetch (tree arglist) ...@@ -922,28 +922,29 @@ expand_builtin_prefetch (tree arglist)
/* Argument 1 (read/write flag) must be a compile-time constant int. */ /* Argument 1 (read/write flag) must be a compile-time constant int. */
if (TREE_CODE (arg1) != INTEGER_CST) if (TREE_CODE (arg1) != INTEGER_CST)
{ {
error ("second arg to %<__builtin_prefetch%> must be a constant"); error ("second argument to %<__builtin_prefetch%> must be a constant");
arg1 = integer_zero_node; arg1 = integer_zero_node;
} }
op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
/* Argument 1 must be either zero or one. */ /* Argument 1 must be either zero or one. */
if (INTVAL (op1) != 0 && INTVAL (op1) != 1) if (INTVAL (op1) != 0 && INTVAL (op1) != 1)
{ {
warning ("invalid second arg to %<__builtin_prefetch%>; using zero"); warning ("invalid second argument to %<__builtin_prefetch%>;"
" using zero");
op1 = const0_rtx; op1 = const0_rtx;
} }
/* Argument 2 (locality) must be a compile-time constant int. */ /* Argument 2 (locality) must be a compile-time constant int. */
if (TREE_CODE (arg2) != INTEGER_CST) if (TREE_CODE (arg2) != INTEGER_CST)
{ {
error ("third arg to %<__builtin_prefetch%> must be a constant"); error ("third argument to %<__builtin_prefetch%> must be a constant");
arg2 = integer_zero_node; arg2 = integer_zero_node;
} }
op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
/* Argument 2 must be 0, 1, 2, or 3. */ /* Argument 2 must be 0, 1, 2, or 3. */
if (INTVAL (op2) < 0 || INTVAL (op2) > 3) if (INTVAL (op2) < 0 || INTVAL (op2) > 3)
{ {
warning ("invalid third arg to %<__builtin_prefetch%>; using zero"); warning ("invalid third argument to %<__builtin_prefetch%>; using zero");
op2 = const0_rtx; op2 = const0_rtx;
} }
...@@ -4158,9 +4159,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist) ...@@ -4158,9 +4159,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
else if (! host_integerp (TREE_VALUE (arglist), 1)) else if (! host_integerp (TREE_VALUE (arglist), 1))
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
error ("invalid arg to %<__builtin_frame_address%>"); error ("invalid argument to %<__builtin_frame_address%>");
else else
error ("invalid arg to %<__builtin_return_address%>"); error ("invalid argument to %<__builtin_return_address%>");
return const0_rtx; return const0_rtx;
} }
else else
...@@ -4174,9 +4175,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist) ...@@ -4174,9 +4175,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
if (tem == NULL) if (tem == NULL)
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
warning ("unsupported arg to %<__builtin_frame_address%>"); warning ("unsupported argument to %<__builtin_frame_address%>");
else else
warning ("unsupported arg to %<__builtin_return_address%>"); warning ("unsupported argument to %<__builtin_return_address%>");
return const0_rtx; return const0_rtx;
} }
...@@ -4279,7 +4280,7 @@ expand_builtin_expect (tree arglist, rtx target) ...@@ -4279,7 +4280,7 @@ expand_builtin_expect (tree arglist, rtx target)
if (TREE_CODE (c) != INTEGER_CST) if (TREE_CODE (c) != INTEGER_CST)
{ {
error ("second arg to %<__builtin_expect%> must be a constant"); error ("second argument to %<__builtin_expect%> must be a constant");
c = integer_zero_node; c = integer_zero_node;
} }
......
...@@ -4577,7 +4577,7 @@ handle_alias_attribute (tree *node, tree name, tree args, ...@@ -4577,7 +4577,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
id = TREE_VALUE (args); id = TREE_VALUE (args);
if (TREE_CODE (id) != STRING_CST) if (TREE_CODE (id) != STRING_CST)
{ {
error ("alias arg not a string"); error ("alias argument not a string");
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
...@@ -4632,7 +4632,7 @@ handle_visibility_attribute (tree *node, tree name, tree args, ...@@ -4632,7 +4632,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
if (TREE_CODE (id) != STRING_CST) if (TREE_CODE (id) != STRING_CST)
{ {
error ("visibility arg not a string"); error ("visibility argument not a string");
return NULL_TREE; return NULL_TREE;
} }
...@@ -4653,7 +4653,7 @@ handle_visibility_attribute (tree *node, tree name, tree args, ...@@ -4653,7 +4653,7 @@ handle_visibility_attribute (tree *node, tree name, tree args,
else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0) else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0)
DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED; DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED;
else else
error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""); error ("visibility argument must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
DECL_VISIBILITY_SPECIFIED (decl) = 1; DECL_VISIBILITY_SPECIFIED (decl) = 1;
/* For decls only, go ahead and attach the attribute to the node as well. /* For decls only, go ahead and attach the attribute to the node as well.
...@@ -4722,7 +4722,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args, ...@@ -4722,7 +4722,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
id = TREE_VALUE (args); id = TREE_VALUE (args);
if (TREE_CODE (id) != STRING_CST) if (TREE_CODE (id) != STRING_CST)
{ {
error ("tls_model arg not a string"); error ("tls_model argument not a string");
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
...@@ -4731,7 +4731,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args, ...@@ -4731,7 +4731,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
&& strcmp (TREE_STRING_POINTER (id), "local-dynamic") && strcmp (TREE_STRING_POINTER (id), "local-dynamic")
&& strcmp (TREE_STRING_POINTER (id), "global-dynamic")) && strcmp (TREE_STRING_POINTER (id), "global-dynamic"))
{ {
error ("tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\""); error ("tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"");
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
...@@ -4993,7 +4993,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -4993,7 +4993,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (!get_nonnull_operand (TREE_VALUE (args), &arg_num)) if (!get_nonnull_operand (TREE_VALUE (args), &arg_num))
{ {
error ("nonnull argument has invalid operand number (arg %lu)", error ("nonnull argument has invalid operand number (argument %lu)",
(unsigned long) attr_arg_num); (unsigned long) attr_arg_num);
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
...@@ -5012,7 +5012,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -5012,7 +5012,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (!argument if (!argument
|| TREE_CODE (TREE_VALUE (argument)) == VOID_TYPE) || TREE_CODE (TREE_VALUE (argument)) == VOID_TYPE)
{ {
error ("nonnull argument with out-of-range operand number (arg %lu, operand %lu)", error ("nonnull argument with out-of-range operand number (argument %lu, operand %lu)",
(unsigned long) attr_arg_num, (unsigned long) arg_num); (unsigned long) attr_arg_num, (unsigned long) arg_num);
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
...@@ -5020,7 +5020,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), ...@@ -5020,7 +5020,7 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name),
if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE) if (TREE_CODE (TREE_VALUE (argument)) != POINTER_TYPE)
{ {
error ("nonnull argument references non-pointer operand (arg %lu, operand %lu)", error ("nonnull argument references non-pointer operand (argument %lu, operand %lu)",
(unsigned long) attr_arg_num, (unsigned long) arg_num); (unsigned long) attr_arg_num, (unsigned long) arg_num);
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
...@@ -5154,7 +5154,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param, ...@@ -5154,7 +5154,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param,
return; return;
if (integer_zerop (param)) if (integer_zerop (param))
warning ("null argument where non-null required (arg %lu)", warning ("null argument where non-null required (argument %lu)",
(unsigned long) param_num); (unsigned long) param_num);
} }
...@@ -5225,14 +5225,14 @@ handle_cleanup_attribute (tree *node, tree name, tree args, ...@@ -5225,14 +5225,14 @@ handle_cleanup_attribute (tree *node, tree name, tree args,
cleanup_id = TREE_VALUE (args); cleanup_id = TREE_VALUE (args);
if (TREE_CODE (cleanup_id) != IDENTIFIER_NODE) if (TREE_CODE (cleanup_id) != IDENTIFIER_NODE)
{ {
error ("cleanup arg not an identifier"); error ("cleanup argument not an identifier");
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
cleanup_decl = lookup_name (cleanup_id); cleanup_decl = lookup_name (cleanup_id);
if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL) if (!cleanup_decl || TREE_CODE (cleanup_decl) != FUNCTION_DECL)
{ {
error ("cleanup arg not a function"); error ("cleanup argument not a function");
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
......
...@@ -1063,7 +1063,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) ...@@ -1063,7 +1063,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
for the arg. */ for the arg. */
else if (!comptypes (oldargtype, newargtype)) else if (!comptypes (oldargtype, newargtype))
{ {
error ("%Jprototype for %qD declares arg %d with incompatible type", error ("%Jprototype for %qD declares argument %d"
" with incompatible type",
newdecl, newdecl, i); newdecl, newdecl, i);
return false; return false;
} }
......
...@@ -139,7 +139,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, ...@@ -139,7 +139,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
!= char_type_node)) != char_type_node))
{ {
if (!(flags & (int) ATTR_FLAG_BUILT_IN)) if (!(flags & (int) ATTR_FLAG_BUILT_IN))
error ("format string arg not a string type"); error ("format string argument not a string type");
*no_add_attrs = true; *no_add_attrs = true;
return false; return false;
} }
...@@ -219,7 +219,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) ...@@ -219,7 +219,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num) if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num)
{ {
gcc_assert (!validated_p); gcc_assert (!validated_p);
error ("format string arg follows the args to be formatted"); error ("format string argument follows the args to be formatted");
return false; return false;
} }
...@@ -2069,7 +2069,7 @@ check_format_types (format_wanted_type *types, const char *format_start, ...@@ -2069,7 +2069,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0 && i == 0
&& cur_param != 0 && cur_param != 0
&& integer_zerop (cur_param)) && integer_zerop (cur_param))
warning ("writing through null pointer (arg %d)", warning ("writing through null pointer (argument %d)",
arg_num); arg_num);
/* Check for reading through a NULL pointer. */ /* Check for reading through a NULL pointer. */
...@@ -2077,7 +2077,7 @@ check_format_types (format_wanted_type *types, const char *format_start, ...@@ -2077,7 +2077,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& i == 0 && i == 0
&& cur_param != 0 && cur_param != 0
&& integer_zerop (cur_param)) && integer_zerop (cur_param))
warning ("reading through null pointer (arg %d)", warning ("reading through null pointer (argument %d)",
arg_num); arg_num);
if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR) if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR)
...@@ -2097,7 +2097,8 @@ check_format_types (format_wanted_type *types, const char *format_start, ...@@ -2097,7 +2097,8 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (CONSTANT_CLASS_P (cur_param) && (CONSTANT_CLASS_P (cur_param)
|| (DECL_P (cur_param) || (DECL_P (cur_param)
&& TREE_READONLY (cur_param)))))) && TREE_READONLY (cur_param))))))
warning ("writing into constant object (arg %d)", arg_num); warning ("writing into constant object (argument %d)",
arg_num);
/* If there are extra type qualifiers beyond the first /* If there are extra type qualifiers beyond the first
indirection, then this makes the types technically indirection, then this makes the types technically
...@@ -2107,7 +2108,8 @@ check_format_types (format_wanted_type *types, const char *format_start, ...@@ -2107,7 +2108,8 @@ check_format_types (format_wanted_type *types, const char *format_start,
&& (TYPE_READONLY (cur_type) && (TYPE_READONLY (cur_type)
|| TYPE_VOLATILE (cur_type) || TYPE_VOLATILE (cur_type)
|| TYPE_RESTRICT (cur_type))) || TYPE_RESTRICT (cur_type)))
warning ("extra type qualifiers in format argument (arg %d)", warning ("extra type qualifiers in format argument "
"(argument %d)",
arg_num); arg_num);
} }
......
2004-11-09 Joseph S. Myers <joseph@codesourcery.com> 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/builtin-prefetch-1.c: Update expected diagnostic.
2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/builtin-prefetch-1.c: Adjust expected messages. * gcc.dg/builtin-prefetch-1.c: Adjust expected messages.
2004-11-08 Steve Ellcey <sje@cup.hp.com> 2004-11-08 Steve Ellcey <sje@cup.hp.com>
......
...@@ -28,12 +28,12 @@ good (int *p) ...@@ -28,12 +28,12 @@ good (int *p)
void void
bad (int *p) bad (int *p)
{ {
__builtin_prefetch (p, -1, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, -1, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 2, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, 2, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, bogus, 0); /* { dg-warning "invalid second arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, bogus, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, -1); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, 0, -1); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, 4); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, 0, 4); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
__builtin_prefetch (p, 0, bogus); /* { dg-warning "invalid third arg to '__builtin_prefetch'; using zero" } */ __builtin_prefetch (p, 0, bogus); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
} }
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment