https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106809
Bug ID: 106809 Summary: [12 regression] large bison grammars compilation got a lot slower, mainly due to -Wuninitialized Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: andres at anarazel dot de CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 53529 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53529&action=edit preprocessed input file showing slowdown Hi, I noticed that building the .c output from bison got a lot slower in 12, compared to 11. $ gcc-12 --version gcc-12 (Debian 12.2.0-1) 12.2.0 Copyright (C) 2022 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. $ gcc-12 preproc.i -c -Wuninitialized real 0m3.558s user 0m3.475s sys 0m0.083s $ time gcc-11 preproc.i -c -Wuninitialized real 0m1.232s user 0m1.150s sys 0m0.082s This is a pretty egregious case, for saner grammars the performance difference is smaller. There's also a performance difference without -Wuninitialized, but it's much smaller (1.090s -> 1.314s) Looking at -ftime-report, there's a very clear difference in how much time is spent in "uninit var analysis" 11: uninit var analysis : 0.01 ( 1%) 0.00 ( 0%) 0.00 ( 0%) 10k ( 0%) 12: uninit var analysis : 2.24 ( 63%) 0.00 ( 0%) 2.26 ( 55%) 393k ( 1%) Regards, andres