public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/106661] New: possible uninitialized variable usage in store_bit_field_1
@ 2022-08-16 23:59 pinskia at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2022-08-16 23:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106661

            Bug ID: 106661
           Summary: possible uninitialized variable usage in
                    store_bit_field_1
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Compiling the trunk with GCC 7.5.0 for a cross to riscv32-linux-gnu produces
the following warning:
In file included from
/bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/coretypes.h:475:0,
                 from
/bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/expmed.cc:26:
/bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/poly-int.h: In function
‘bool store_bit_field_1(rtx, poly_uint64, poly_uint64, poly_uint64,
poly_uint64, machine_mode, rtx, bool, bool, bool)’:
/bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/poly-int.h:1107:38:
warning: ‘regnum’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
     POLY_SET_COEFF (C, r, i, NCa (a) * b.coeffs[i]);
                                      ^
/bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/expmed.cc:797:21: note:
‘regnum’ was declared here
       HOST_WIDE_INT regnum;
                     ^~~~~~


I looked into the code I think the warning is correct, regnum could be
uninitialized if undefined_p is true but constant_multiple_p returns false.
I have not looked into if the warning happens for the trunk or why x86_64 does
not get the warning.

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

only message in thread, other threads:[~2022-08-16 23:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 23:59 [Bug middle-end/106661] New: possible uninitialized variable usage in store_bit_field_1 pinskia at gcc dot gnu.org

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).