[Bug c++/105838] g++ 12.1.0 runs out of memory or time when building const std::vector of std::strings

2022-06-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105838

--- Comment #3 from Richard Biener  ---
Created attachment 53133
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53133=edit
unincluded, and reduced

This "reduced" testcase peaks at 3.8GB memory.

> /usr/bin/time /space/rguenther/install/gcc-12.1/bin/g++ -S -O /tmp/t.C
8.68user 1.13system 0:10.03elapsed 97%CPU (0avgtext+0avgdata
3813480maxresident)k
17328inputs+2104outputs (28major+961476minor)pagefaults 0swaps

simply doubling the initializer grows it to 14.8GB

> /usr/bin/time /space/rguenther/install/gcc-12.1/bin/g++ -S -O /tmp/t.C
43.02user 4.49system 0:47.51elapsed 99%CPU (0avgtext+0avgdata
14861052maxresident)k
0inputs+4088outputs (0major+3727738minor)pagefaults 0swaps

[Bug c++/105838] g++ 12.1.0 runs out of memory or time when building const std::vector of std::strings

2022-06-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105838

Richard Biener  changed:

   What|Removed |Added

  Known to fail||10.3.0

--- Comment #2 from Richard Biener  ---
GCC 10 is also an order of magnitude slower.

[Bug c++/105838] g++ 12.1.0 runs out of memory or time when building const std::vector of std::strings

2022-06-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105838

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-06-13

--- Comment #1 from Richard Biener  ---
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.