public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/100524] New: pragma GCC diagnostic ignored "-Wanalyzer-too-complex" ignored by cc1
@ 2021-05-11 14:46 andrew at ishiboo dot com
  2021-11-30 19:23 ` [Bug analyzer/100524] " dmalcolm at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: andrew at ishiboo dot com @ 2021-05-11 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100524

            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=analyzer-too-complex ...

Source code contains a function that generates a -Wanalyzer-too-complex error
(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 => emptySlots$1_80EN: 973-975, EN: 1017-1018, EN: 1054-1056
[-Werror=analyzer-too-complex]
  test.c: At top level:
  test.c:516:22: error analysis bailed out early (916 'after-snode' enodes;
3258 enodes) [-Werror=analyzer-too-complex]
    516 | ...
        |
  cc1: all warnings being treated as errors

Placing pragma diagnostic guards around the function in question silences the
compiler front-end error, but cc1 still produces the same errors and fails with
-Werror=analyzer-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 => emptySlots$1_80EN: 973-975, EN: 1017-1018, EN: 1054-1056
[-Werror=analyzer-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 specific
complex portions of code in this manner.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-01  0:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 14:46 [Bug analyzer/100524] New: pragma GCC diagnostic ignored "-Wanalyzer-too-complex" ignored by cc1 andrew at ishiboo dot com
2021-11-30 19:23 ` [Bug analyzer/100524] " dmalcolm at gcc dot gnu.org
2021-11-30 22:50 ` cvs-commit at gcc dot gnu.org
2021-11-30 23:04 ` dmalcolm at gcc dot gnu.org
2021-12-01  0:29 ` egallager at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).