]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Avoid '-Wmaybe-uninitialized' diagnostic in 'gcc/dwarf2out.c'
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 30 Oct 2019 10:50:58 +0000 (11:50 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Wed, 30 Oct 2019 10:50:58 +0000 (11:50 +0100)
With '--enable-checking=yes,extra,rtl':

    In file included from [...]/source-gcc/gcc/coretypes.h:433,
                     from [...]/source-gcc/gcc/dwarf2out.c:60:
    [...]/source-gcc/gcc/machmode.h: In function 'dw_loc_descr_node* mem_loc_descriptor(rtx, machine_mode, machine_mode, var_init_status)':
    [...]/source-gcc/gcc/machmode.h:520:42: error: 'int_mode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      520 |    ? mode_size_inline (mode) : mode_size[mode]);
          |                                          ^~~~
    [...]/source-gcc/gcc/dwarf2out.c:15464:19: note: 'int_mode' was declared here
    15464 |   scalar_int_mode int_mode, inner_mode, op1_mode;
          |                   ^~~~~~~~
    cc1plus: all warnings being treated as errors
    make[3]: *** [dwarf2out.o] Error 1

Backport trunk r270903.

2019-05-06  Richard Biener  <rguenther@suse.de>

* dwarf2out.c (mem_loc_descriptor): Initialize int_mode.

From-SVN: r277608

gcc/ChangeLog
gcc/dwarf2out.c

index 910887a845129822a555ea1b7279096df021b64c..ce4630ba07829e1a3e39ba8bebd11f3703d2ff76 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-30  Thomas Schwinge  <thomas@codesourcery.com>
+
+       Backport from trunk:
+
+       2019-05-06  Richard Biener  <rguenther@suse.de>
+
+       * dwarf2out.c (mem_loc_descriptor): Initialize int_mode.
+
 2019-10-28  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR target/92225
index 55a73e12cc258227f568d17179990585a18e1513..ae47387b763f3a7edfa1f4b0dc546d0919b15732 100644 (file)
@@ -15461,7 +15461,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
   if (mode != GET_MODE (rtl) && GET_MODE (rtl) != VOIDmode)
     return NULL;
 
-  scalar_int_mode int_mode, inner_mode, op1_mode;
+  scalar_int_mode int_mode = BImode, inner_mode, op1_mode;
   switch (GET_CODE (rtl))
     {
     case POST_INC: