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

            Bug ID: 104954
           Summary: Analyzer takes a very long time on Linux kernel
                    drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

According to my notes, attempting to build a Linux kernel with -fanalyzer, I
found that building:
  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c
was taking over 15 hours; I think this was with a debug build of cc1.

On testing this with trunk this week, I saw it take about 31 minutes on a debug
build, and about 4 minutes on a release build.

Am attaching preprocessed source.

Compilation flags in use the 4 minute build (with release build of cc1):

./xgcc -B. -fanalyzer -S ../../src/dce_calcs.i -nostdinc -fmacro-prefix-map=./=
-Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration
-Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89
-mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64
-falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387
-mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone
-mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables
-mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables
-fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation
-Wno-format-overflow -Wno-address-of-packed-member -O2
-fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector-strong
-Wimplicit-fallthrough=5 -Wno-unused-but-set-variable
-Wno-unused-const-variable -fno-stack-clash-protection -g -pg -mrecord-mcount
-mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once
-Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation
-Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict
-Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack
-Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init
-Wno-packed-not-aligned -fanalyzer -Wno-analyzer-null-dereference
-Wno-analyzer-use-of-uninitialized-value -Wno-array-bounds
-Wno-analyzer-null-argument -Wno-analyzer-shift-count-overflow
-Wno-analyzer-use-of-pointer-in-stale-stack-frame
-Wno-analyzer-shift-count-negative -Wno-analyzer-write-to-const
-Wno-use-after-free -fsanitize=kernel-address
-fasan-shadow-offset=0xdffffc0000000000   --param asan-globals=1   --param
asan-instrumentation-with-call-threshold=10000   --param
asan-instrument-allocas=1   --param asan-stack=1

(i.e. with various -Wno-analyzer-* flags; perhaps re-enabling these will
trigger the more extreme multihour slowdown)

Reply via email to