From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 35AB43858C2D; Tue, 16 Aug 2022 23:59:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35AB43858C2D From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/106661] New: possible uninitialized variable usage in store_bit_field_1 Date: Tue, 16 Aug 2022 23:59:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2022 23:59:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106661 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 functi= on =E2=80=98bool store_bit_field_1(rtx, poly_uint64, poly_uint64, poly_uint64, poly_uint64, machine_mode, rtx, bool, bool, bool)=E2=80=99: /bajas/pinskia/src/toolchain-riscv/scripts/../src/gcc/poly-int.h:1107:38: warning: =E2=80=98regnum=E2=80=99 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: not= e: =E2=80=98regnum=E2=80=99 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 d= oes not get the warning.=