https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105838
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2022-06-13 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed with -O1. At -O0 I see > /usr/bin/time /space/rguenther/install/gcc-12.1/bin/g++ -S t.C 13.44user 0.34system 0:15.71elapsed 87%CPU (0avgtext+0avgdata 1139560maxresident)k 65584inputs+23864outputs (77major+275588minor)pagefaults 0swaps with -O1 it uses >20GB of memory in cleanup_all_empty_eh. It might be the order of optimizing this is exposing some quadratic amount of edge redirection, I have not yet analyzed this in detail but trimming down the testcase should help here. There isn't much allocation done here besides the edge redirection SSA update stuff for PHIs.