From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 637C13854830; Fri, 2 Apr 2021 17:38:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 637C13854830 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/81714] incorrect location for uninitialised variable Date: Fri, 02 Apr 2021 17:38:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.0.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_known_to_fail cf_reconfirmed_on Message-ID: In-Reply-To: References: 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: Fri, 02 Apr 2021 17:38:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81714 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail|6.4.0, 7.3.0, 8.0 |10.2.0, 11.0, 6.3.0, 7.0.1, | |8.3.0, 9.3.0 Last reconfirmed|2018-02-02 00:00:00 |2021-4-2 --- Comment #2 from Martin Sebor --- Reconfirmed with GCC 11. This doesn't look like a problem with -Wuninitial= ized but rather much earlier. The Gimple dump already has the wrong column numb= er: $ cat pr81714.c && gcc -S -Wall -fdump-tree-gimple-lineno=3D/dev/stdout -xc= ++ pr81714.c int f0 () { int i; return i + 1; } int f1 () {=20 int i; return 2 + i; } int f0 () [pr81714.c:4:15] { int D.2352; int i; [pr81714.c:4:14] D.2352 =3D i + 1; [pr81714.c:4:14] return D.2352; } int f1 () [pr81714.c:10:15] { int D.2354; int i; [pr81714.c:10:14] D.2354 =3D i + 2; [pr81714.c:10:14] return D.2354; } pr81714.c: In function =E2=80=98int f0()=E2=80=99: pr81714.c:4:14: warning: =E2=80=98i=E2=80=99 is used uninitialized [-Wunini= tialized] 4 | return i + 1; | ^ pr81714.c:3:7: note: =E2=80=98i=E2=80=99 was declared here 3 | int i; | ^ pr81714.c: In function =E2=80=98int f1()=E2=80=99: pr81714.c:10:14: warning: =E2=80=98i=E2=80=99 is used uninitialized [-Wunin= itialized] 10 | return 2 + i; | ^ pr81714.c:9:7: note: =E2=80=98i=E2=80=99 was declared here 9 | int i; | ^ Other middle-end warnings are also affected (e.g., -Warray-bounds).=