From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A513385782A; Mon, 13 Sep 2021 10:14:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A513385782A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102276] -ftrivial-auto-var-init fails to initialize a variable, causes a spurious warning Date: Mon, 13 Sep 2021 10:14:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: everconfirmed bug_status cc 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: Mon, 13 Sep 2021 10:14:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102276 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |qing.zhao at oracle dot co= m, | |rguenth at gcc dot gnu.org Last reconfirmed| |2021-09-13 --- Comment #1 from Richard Biener --- Both cases jump past the initialization - for C++ this would be a invalid testcase I guess while for C we'd warn if the 'x' were initialized. I'm not sure if it is reasonably possible to "fix" these cases. Confirmed for the spurious warning, it is emitted by gimplification on switch (0) > { int x; try { _1 =3D .DEFERRED_INIT (4, 1, 0); x =3D _1; __builtin_clear_padding (&x, 0B, 1); : D.1989 =3D g (&x); return D.1989; } finally { x =3D {CLOBBER}; } }=