From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0822E3858414; Tue, 30 Nov 2021 19:23:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0822E3858414 From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/100524] pragma GCC diagnostic ignored "-Wanalyzer-too-complex" ignored by cc1 Date: Tue, 30 Nov 2021 19:23:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: WAITING 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_status cf_reconfirmed_on everconfirmed 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: Tue, 30 Nov 2021 19:23:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100524 David Malcolm changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2021-11-30 Ever confirmed|0 |1 --- Comment #1 from David Malcolm --- Thanks for filing this bug. Firstly, what you wrote in comment #0 has the directive transposed as: #pragma diagnostic GCC [...action...] whereas the directive should be: #pragma GCC diagnostic [...action...] I've tested the latter with a simple reproducer and verified that I can dis= able -Wanalyzer-too-complex with it, whereas the transposed version of the direc= tive is ignored by GCC and thus does nothing; I'm working on a regression test f= or this. Secondly, there's an issue with source locations in the diagnostic you quot= ed: the prefix: "cc1: error: " doesn't contain a source location. Internally this comes from diagnostic_build_prefix when the diagnostic's location has a NULL filename, which is most likely due to a statement with an UNKNOWN_LOCATION. So the issue is due to a statement in GCC's gimple-ssa IR having UNKNOWN_LOCATION for its location, which thus doesn't show up within the ra= nge of source locations expressed by the pragma, and thus the diagnostic isn't affected by the pragmas. The fix would be to fix the location of the statement in the gimple-ssa IR,= but without a reproducer to identify where that statement's coming from (e.g. in one of the passes that runs before the analyzer), that's hard to do. Do you still have the code that reproduces this issue? (and the precise optimization flags)=