i386: Resolve variable shadowing in i386-options.c [PR98671]
Also change global variable pta_size to unsigned. 2021-01-14 Uroš Bizjak <ubizjak@gmail.com> gcc/ PR target/98671 * config/i386/i386-options.c (ix86_valid_target_attribute_inner_p): Remove declaration and initialization of shadow variable "ret". (ix86_option_override_internal): Remove delcaration of shadow variable "i". Redeclare shadowed variable to unsigned. * common/config/i386/i386-common.c (pta_size): Redeclare to unsigned. * config/i386/i386-builtins.c (get_builtin_code_for_version): Update for redeclaration. * config/i386/i386.h (pta_size): Ditto.
This commit is contained in:
parent
2182274f51
commit
5ebdd53534
4 changed files with 5 additions and 7 deletions
|
@ -2051,7 +2051,7 @@ const pta processor_alias_table[] =
|
|||
};
|
||||
|
||||
/* NB: processor_alias_table stops at the "generic" entry. */
|
||||
int const pta_size = ARRAY_SIZE (processor_alias_table) - 6;
|
||||
unsigned int const pta_size = ARRAY_SIZE (processor_alias_table) - 6;
|
||||
unsigned int const num_arch_names = ARRAY_SIZE (processor_alias_table);
|
||||
|
||||
/* Provide valid option values for -march and -mtune options. */
|
||||
|
|
|
@ -1888,7 +1888,7 @@ get_builtin_code_for_version (tree decl, tree *predicate_list)
|
|||
gcc_assert (new_target);
|
||||
|
||||
if (new_target->arch_specified && new_target->arch > 0)
|
||||
for (i = 0; i < (unsigned int) pta_size; i++)
|
||||
for (i = 0; i < pta_size; i++)
|
||||
if (processor_alias_table[i].processor == new_target->arch)
|
||||
{
|
||||
const pta *arch_info = &processor_alias_table[i];
|
||||
|
|
|
@ -1088,8 +1088,6 @@ ix86_valid_target_attribute_inner_p (tree fndecl, tree args, char *p_strings[],
|
|||
/* If this is a list, recurse to get the options. */
|
||||
if (TREE_CODE (args) == TREE_LIST)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
for (; args; args = TREE_CHAIN (args))
|
||||
if (TREE_VALUE (args)
|
||||
&& !ix86_valid_target_attribute_inner_p (fndecl, TREE_VALUE (args),
|
||||
|
@ -1782,7 +1780,7 @@ ix86_option_override_internal (bool main_args_p,
|
|||
struct gcc_options *opts,
|
||||
struct gcc_options *opts_set)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
unsigned HOST_WIDE_INT ix86_arch_mask;
|
||||
const bool ix86_tune_specified = (opts->x_ix86_tune_string != NULL);
|
||||
|
||||
|
@ -2852,7 +2850,7 @@ ix86_option_override_internal (bool main_args_p,
|
|||
{
|
||||
char *p = ASTRDUP (opts->x_ix86_recip_name);
|
||||
char *q;
|
||||
unsigned int mask, i;
|
||||
unsigned int mask;
|
||||
bool invert;
|
||||
|
||||
while ((q = strtok (p, ",")) != NULL)
|
||||
|
|
|
@ -2562,7 +2562,7 @@ public:
|
|||
};
|
||||
|
||||
extern const pta processor_alias_table[];
|
||||
extern int const pta_size;
|
||||
extern unsigned int const pta_size;
|
||||
extern unsigned int const num_arch_names;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue