From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 487F63987C25; Tue, 11 May 2021 14:46:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 487F63987C25 From: "andrew at ishiboo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/100524] New: pragma GCC diagnostic ignored "-Wanalyzer-too-complex" ignored by cc1 Date: Tue, 11 May 2021 14:46:31 +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: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andrew at ishiboo dot com 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, 11 May 2021 14:46:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100524 Bug ID: 100524 Summary: pragma GCC diagnostic ignored "-Wanalyzer-too-complex" ignored by cc1 Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: andrew at ishiboo dot com Target Milestone: --- Invoking the compiler from the command line as: gcc -fanalyzer -Wanalyzer-too-complex -Werror=3Danalyzer-too-complex ... Source code contains a function that generates a -Wanalyzer-too-complex err= or (exact error unimportant): ... cc1: error: terminating analysis for this program point: callstring: [(SN= : 17 -> SN: 9 in X), (SN: 141 -> SN: 16 in X)] before (SN: 115 stmt: 0): # DEBUG emptySlots$1 =3D> emptySlots$1_80EN: 973-975, EN: 1017-1018, EN: 1054-1056 [-Werror=3Danalyzer-too-complex] test.c: At top level: test.c:516:22: error analysis bailed out early (916 'after-snode' enodes; 3258 enodes) [-Werror=3Danalyzer-too-complex] 516 | ... | cc1: all warnings being treated as errors Placing pragma diagnostic guards around the function in question silences t= he compiler front-end error, but cc1 still produces the same errors and fails = with -Werror=3Danalyzer-too-complex: #pragma diagnostic GCC push #pragma diagnostic GCC ignored "-Wanalyzer-too-complex" // function definition that generates the error #pragma diagnostic GCC pop Output: ... cc1: error: terminating analysis for this program point: callstring: [(SN= : 17 -> SN: 9 in X), (SN: 141 -> SN: 16 in X)] before (SN: 115 stmt: 0): # DEBUG emptySlots$1 =3D> emptySlots$1_80EN: 973-975, EN: 1017-1018, EN: 1054-1056 [-Werror=3Danalyzer-too-complex] cc1: all warnings being treated as errors The "test.c" output with the compiler error and source code context are no longer output, but cc1 still produces a fatal error and halts compilation. I would expect that if the warning is `#pragma diagnostic GCC ignored` that= cc1 would respect this, otherwise it is not possible to fine-grain ignore speci= fic complex portions of code in this manner.=