From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0BF1B3858012; Thu, 25 Mar 2021 16:07:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BF1B3858012 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/99768] [11 Regression] Bogus -Wuninitialized diagnostic with type punning Date: Thu, 25 Mar 2021 16:07:01 +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: 11.0 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: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status component everconfirmed cc 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: Thu, 25 Mar 2021 16:07:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99768 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-03-25 Status|UNCONFIRMED |NEW Component|c |middle-end Ever confirmed|0 |1 CC| |msebor at gcc dot gnu.org --- Comment #2 from Martin Sebor --- The -Wuninitialized was introduced in g:b825a22890740f341eae566af27e18e528cd29a7. I don't think I meant for this= to be diagnosed so I suspect it's a bug in the new code. I see no basis in th= e IL (below) to issue the warning. GCC should issue -Wstrict-aliasing instead (= it does but only at level 2). float foo (unsigned int v) { float * f; unsigned int tmp; float _5; : tmp =3D v_2(D); f_4 =3D &tmp; _5 =3D *f_4; << -Wuninitialized tmp =3D{v} {CLOBBER}; return _5; }=