public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6671] i386: Resolve variable shadowing in i386-options.c [PR98671]
@ 2021-01-14 15:29 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2021-01-14 15:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5ebdd53534db25401473db5f6a0ad30f41410241

commit r11-6671-g5ebdd53534db25401473db5f6a0ad30f41410241
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Jan 14 16:28:27 2021 +0100

    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.

Diff:
---
 gcc/common/config/i386/i386-common.c | 2 +-
 gcc/config/i386/i386-builtins.c      | 2 +-
 gcc/config/i386/i386-options.c       | 6 ++----
 gcc/config/i386/i386.h               | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index 00843d4bd93..eea8af12f48 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -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.  */
diff --git a/gcc/config/i386/i386-builtins.c b/gcc/config/i386/i386-builtins.c
index 5b37fc7b75e..4fcdf4b89ee 100644
--- a/gcc/config/i386/i386-builtins.c
+++ b/gcc/config/i386/i386-builtins.c
@@ -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];
diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
index 4e0165ff32c..6819a042389 100644
--- a/gcc/config/i386/i386-options.c
+++ b/gcc/config/i386/i386-options.c
@@ -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)
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f032746d222..272b1957b47 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-14 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 15:29 [gcc r11-6671] i386: Resolve variable shadowing in i386-options.c [PR98671] Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).