public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glebfm at altlinux dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/103602] New: [11 regression] Analyzer takes inadequate amount of memory and time linking GNU grep with LTO
Date: Tue, 07 Dec 2021 12:19:49 +0000	[thread overview]
Message-ID: <bug-103602-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 103602
           Summary: [11 regression] Analyzer takes inadequate amount of
                    memory and time linking GNU grep with LTO
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: glebfm at altlinux dot org
  Target Milestone: ---

$ gcc --version
x86_64-alt-linux-gcc (GCC) 11.2.1 20211202 (ALT Sisyphus 11.2.1-alt2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ git clone https://git.savannah.gnu.org/git/grep.git && cd grep && ./bootstrap
&& CFLAGS='-g -O2 -flto=auto -Wno-error' ./configure && /usr/bin/time make
-j`nproc`
...
178.93user 6.85system 2:56.67elapsed 105%CPU (0avgtext+0avgdata
7943640maxresident)k
0inputs+0outputs (0major+2626777minor)pagefaults 0swaps

$ cd src && /usr/bin/time gcc -fanalyzer -fno-common -Wall -Warith-conversion
-Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization
-Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra
-Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op
-Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes
-Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd
-Woverlength-strings -Wpacked -Wpointer-arith -Wshadow -Wstrict-prototypes
-Wsuggest-attribute=cold -Wsuggest-attribute=const -Wsuggest-attribute=format
-Wsuggest-attribute=malloc -Wsuggest-attribute=noreturn
-Wsuggest-attribute=pure -Wsuggest-final-methods -Wsuggest-final-types
-Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros
-Wvariadic-macros -Wvector-operation-performance -Wvla -Wwrite-strings
-Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2
-Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2
-Wunused-const-variable=2 -Wvla-larger-than=4031 -Wno-analyzer-malloc-leak
-Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter
-Wno-cast-function-type -Wno-logical-op -Wno-format-nonliteral -Werror  -g -O2
-flto=auto -Wno-error   -o grep dfasearch.o grep.o kwsearch.o kwset.o
searchutils.o  ../lib/libgreputils.a  ../lib/libgreputils.a
...
175.29user 2.75system 2:56.95elapsed 100%CPU (0avgtext+0avgdata
7934612maxresident)k
0inputs+0outputs (0major+2050508minor)pagefaults 0swaps


(with -fno-analyzer flag)
$ git clone https://git.savannah.gnu.org/git/grep.git && cd grep && ./bootstrap
&& CFLAGS='-g -O2 -flto=auto -fno-analyzer -Wno-error' ./configure &&
/usr/bin/time make -j`nproc`
...
7.53user 5.04system 0:02.66elapsed 471%CPU (0avgtext+0avgdata
65336maxresident)k
0inputs+0outputs (0major+642146minor)pagefaults 0swaps

$ cd src && /usr/bin/time gcc -fanalyzer -fno-common -Wall -Warith-conversion
-Wbad-function-cast -Wcast-align=strict -Wdate-time -Wdisabled-optimization
-Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra
-Wformat-signedness -Winit-self -Winvalid-pch -Wlogical-op
-Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes
-Wnested-externs -Wnull-dereference -Wold-style-definition -Wopenmp-simd
-Woverlength-strings -Wpacked -Wpointer-arith -Wshadow -Wstrict-prototypes
-Wsuggest-attribute=cold -Wsuggest-attribute=const -Wsuggest-attribute=format
-Wsuggest-attribute=malloc -Wsuggest-attribute=noreturn
-Wsuggest-attribute=pure -Wsuggest-final-methods -Wsuggest-final-types
-Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros
-Wvariadic-macros -Wvector-operation-performance -Wvla -Wwrite-strings
-Warray-bounds=2 -Wattribute-alias=2 -Wformat-overflow=2 -Wformat=2
-Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wshift-overflow=2
-Wunused-const-variable=2 -Wvla-larger-than=4031 -Wno-analyzer-malloc-leak
-Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter
-Wno-cast-function-type -Wno-logical-op -Wno-format-nonliteral -Werror  -g -O2
-flto=auto -fno-analyzer -Wno-error   -o grep dfasearch.o grep.o kwsearch.o
kwset.o searchutils.o  ../lib/libgreputils.a  ../lib/libgreputils.a
...
3.31user 0.13system 0:02.33elapsed 147%CPU (0avgtext+0avgdata
65600maxresident)k
0inputs+0outputs (0major+69122minor)pagefaults 0swaps


I bisected this issue to commit r12-1389-g9d20ec97475 (backport
r11-8680-gf018044145e in releases/gcc-11 branch), after this change analyzer
consumes 3 times more memory (2.5G -> 7.5G) to analyze grep.

             reply	other threads:[~2021-12-07 12:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 12:19 glebfm at altlinux dot org [this message]
2021-12-07 12:31 ` [Bug analyzer/103602] " rguenth at gcc dot gnu.org
2022-04-21  7:50 ` [Bug analyzer/103602] [11/12 regression] Analyzer takes excessive " rguenth at gcc dot gnu.org
2023-04-14  4:53 ` [Bug analyzer/103602] [11/12/13 " law at gcc dot gnu.org
2023-05-29 10:06 ` [Bug analyzer/103602] [11/12/13/14 " jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103602-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).