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

            Bug ID: 93773
           Summary: Analyzer probably fails to recognize end of C macros
                    in some cases
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

Created attachment 47857
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47857&action=edit
Compiler output

I failed to come up w/ a reduced testcase and can only provide instructions to
reproduce the issue, so this PR is technically invalid. The issue, however, is
real. It can be seen when compiling gawk and perl, and probably any complex
bison-generated parser.

When emitting "note: in expansion of macro 'YYSTACK_BYTES'" (five times in the
attached output), analyzer quotes the code from the macro expansion point all
the way down to the point where it is used in a file, potentially printing
hundreds or thousands of unrelated lines, which is clearly wrong. It probably
fails to discern end of the macro.

The attached output was produced when building gawk 5.0.1 w/ -O1 -fanalyzer,
particularly when compiling awkgram.c:

CC=gcc-10.0.1 CFLAGS="-O1 -fanalyzer" ./configure
make -k

or, specifically,

gcc-10.0.1 -DHAVE_CONFIG_H -DGAWK -I"./support" -I. -O1 -fanalyzer -DNDEBUG -c
-o awkgram.o awkgram.c

Reply via email to