From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 84FD93858280; Tue, 5 Jul 2022 17:49:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84FD93858280 From: "tlange at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/106203] New: Allow to emit diagnostics at return edges for the exit point as well as the call site Date: Tue, 05 Jul 2022 17:49:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tlange at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm 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, 05 Jul 2022 17:49:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106203 Bug ID: 106203 Summary: Allow to emit diagnostics at return edges for the exit point as well as the call site Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: tlange at gcc dot gnu.org Target Milestone: --- Currently, the region_model_context at return edges, created inside program_state::on_edge, neither holds a stmt nor a stmt_finder and thus, warnings at return edges are rejected by impl_region_model_context::warn. PR105900 has 2 XFAILs inside allocation-size-(1|2).c because the call to set_value (lhs, ) happens at a return edge. Similarly, PR10= 5888 also needs to emit a warning at a return edge, but for the callee's exit po= int. David already expressed ideas on how to solve this: - have two contexts for pop_frame: one in the old frame, the other in the new frame (for the caller) - generalize stmt_finder, so it can also update the supernode to use - rework pop_frame (I've had to do this before, I've run into issues like this before).=