From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9FF853848581; Thu, 9 Jun 2022 23:24:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FF853848581 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/74765] missing uninitialized warning (parenthesis, TREE_NO_WARNING abuse) Date: Thu, 09 Jun 2022 23:24:50 +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 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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, 09 Jun 2022 23:24:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D74765 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.o= rg --- Comment #10 from Eric Botcazou --- I don't understand the new code in gimple_set_location: static inline void gimple_set_location (gimple *g, location_t location) { /* Copy the no-warning data to the statement location. */ copy_warning (location, g->location); g->location =3D location; } Typically g->location is UNKNOWN_LOCATION since the GIMPLE statement was ju= st built so this does: copy_warning (location, UNKNOWN_LOCATION); and finally invokes nowarn_map->remove (location)? I can fix my particular problem by adding the obvious guard: static inline void gimple_set_location (gimple *g, location_t location) { /* Copy the no-warning data to the statement location. */ if (g->location !=3D UNKNOWN_LOCATION) copy_warning (location, g->location); g->location =3D location; } but shouldn't the code query warning-control.cc instead to see if the no-warning bit is set on g?=