gcc-4 -Og false positive "may be used uninitialised"
authorAlan Modra <amodra@gmail.com>
Mon, 24 Aug 2020 03:28:14 +0000 (12:58 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 24 Aug 2020 03:59:22 +0000 (13:29 +0930)
binutils/
* readelf.c (dump_section_as_strings) Avoid false positive
"may be used uninitialised".
gas/
* config/tc-arm.c (move_or_literal_pool): Avoid false positive
"may be used uninitialised".
(opcode_lookup): Likewise.

binutils/ChangeLog
binutils/readelf.c
gas/ChangeLog
gas/config/tc-arm.c

index ef4b8cb3dc036a0840e70f9723ca7e5fbd05fe0d..4be47478b32e0eebafd236c49995e4221574df1a 100644 (file)
@@ -1,3 +1,8 @@
+2020-08-24  Alan Modra  <amodra@gmail.com>
+
+       * readelf.c (dump_section_as_strings) Avoid false positive
+       "may be used uninitialised".
+
 2020-08-22  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/26382
index c47a77ca8fdbbaa7317811e7bdbb0b81d859cf54..86be92e3b0039d84e9cf40cd96869fdc3738580e 100644 (file)
@@ -13968,7 +13968,7 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata)
 
          if (maxlen > 0)
            {
-             char c;
+             char c = 0;
 
              while (maxlen)
                {
index 1aa2792851da7632b91f5e67258aab492f6eb79a..75cf73e749aedbc54fa26c78959e38bca0076e86 100644 (file)
@@ -1,3 +1,9 @@
+2020-08-24  Alan Modra  <amodra@gmail.com>
+
+       * config/tc-arm.c (move_or_literal_pool): Avoid false positive
+       "may be used uninitialised".
+       (opcode_lookup): Likewise.
+
 2020-08-24  Alan Modra  <amodra@gmail.com>
 
        PR 26526
index c5ad2607b37205831d06b0af9433ab134828f339..3eb7e9640a37be6ff4e6af4e0e49ae8be7d33c68 100644 (file)
@@ -8898,16 +8898,13 @@ move_or_literal_pool (int i, enum lit_type t, bfd_boolean mode_3)
                  /* Check if on thumb2 it can be done with a mov.w, mvn or
                     movw instruction.  */
                  unsigned int newimm;
-                 bfd_boolean isNegated;
+                 bfd_boolean isNegated = FALSE;
 
                  newimm = encode_thumb32_immediate (v);
-                 if (newimm != (unsigned int) FAIL)
-                   isNegated = FALSE;
-                 else
+                 if (newimm == (unsigned int) FAIL)
                    {
                      newimm = encode_thumb32_immediate (~v);
-                     if (newimm != (unsigned int) FAIL)
-                       isNegated = TRUE;
+                     isNegated = TRUE;
                    }
 
                  /* The number can be loaded with a mov.w or mvn
@@ -22622,6 +22619,7 @@ opcode_lookup (char **str)
   /* Look for unaffixed or special-case affixed mnemonic.  */
   opcode = (const struct asm_opcode *) str_hash_find_n (arm_ops_hsh, base,
                                                        end - base);
+  cond = NULL;
   if (opcode)
     {
       /* step U */