https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119389
Bug ID: 119389 Summary: [15 Regression] tree FRE very slow when dealing with big switch statements Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: compile-time-hog, needs-bisection Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pheeck at gcc dot gnu.org Target Milestone: --- Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 60833 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60833&action=edit Testcase from pr117091 Consider the testcase from pr117091 (attached). It basically creates a giant switch using the preprocessor. Compiling it with the current trunk GCC with at least -O1 takes hours (I haven't even seen it finish). When I make the testcase significantly smaller - XXXXX(1) + XXXX(1) I actually see the compilation finish but it is still slow. GCC reports that the time is spent in tree FRE. > gcc bugreport.c -O1 -c -ftime-report Time variable wall GGC tree FRE : 263.85 (100%) 496 ( 0%) TOTAL : 265.14 43M So I believe there's something at least quadratic in FRE that this testcase triggers. Btw this is with --enable-checking=release.