From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9EC7B3858401; Tue, 7 Dec 2021 12:19:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EC7B3858401 From: "glebfm at altlinux dot 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 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.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glebfm at altlinux dot org 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, 07 Dec 2021 12:19:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103602 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 && ./boots= trap && CFLAGS=3D'-g -O2 -flto=3Dauto -Wno-error' ./configure && /usr/bin/time m= ake -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-conversi= on -Wbad-function-cast -Wcast-align=3Dstrict -Wdate-time -Wdisabled-optimizati= on -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=3Dcold -Wsuggest-attribute=3Dconst -Wsuggest-attribute= =3Dformat -Wsuggest-attribute=3Dmalloc -Wsuggest-attribute=3Dnoreturn -Wsuggest-attribute=3Dpure -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wvla -Wwrite-strings -Warray-bounds=3D2 -Wattribute-alias=3D2 -Wformat-overflow=3D2 -Wformat=3D2 -Wformat-truncation=3D2 -Wimplicit-fallthrough=3D5 -Wshift-overflow=3D2 -Wunused-const-variable=3D2 -Wvla-larger-than=3D4031 -Wno-analyzer-malloc-l= eak -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-cast-function-type -Wno-logical-op -Wno-format-nonliteral -Werror -g = -O2 -flto=3Dauto -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 && ./boots= trap && CFLAGS=3D'-g -O2 -flto=3Dauto -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-conversi= on -Wbad-function-cast -Wcast-align=3Dstrict -Wdate-time -Wdisabled-optimizati= on -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=3Dcold -Wsuggest-attribute=3Dconst -Wsuggest-attribute= =3Dformat -Wsuggest-attribute=3Dmalloc -Wsuggest-attribute=3Dnoreturn -Wsuggest-attribute=3Dpure -Wsuggest-final-methods -Wsuggest-final-types -Wsync-nand -Wtrampolines -Wuninitialized -Wunknown-pragmas -Wunused-macros -Wvariadic-macros -Wvector-operation-performance -Wvla -Wwrite-strings -Warray-bounds=3D2 -Wattribute-alias=3D2 -Wformat-overflow=3D2 -Wformat=3D2 -Wformat-truncation=3D2 -Wimplicit-fallthrough=3D5 -Wshift-overflow=3D2 -Wunused-const-variable=3D2 -Wvla-larger-than=3D4031 -Wno-analyzer-malloc-l= eak -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-cast-function-type -Wno-logical-op -Wno-format-nonliteral -Werror -g = -O2 -flto=3Dauto -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.=