On Mon, May 15, 2023 at 12:35:23PM +0200, Aldy Hernandez wrote: > gcc/ChangeLog: > > PR tree-optimization/109695 > * value-range.cc (irange::operator=): Resize range. > (irange::union_): Same. > (irange::intersect): Same. > (irange::invert): Same. > (int_range_max): Default to 3 sub-ranges and resize as needed. > * value-range.h (irange::maybe_resize): New. > (~int_range): New. > (int_range::int_range): Adjust for resizing. > (int_range::operator=): Same.
LGTM. One question is if we shouldn't do it for GCC13/GCC12 as well, perhaps changing it to some larger number than 3 when the members aren't wide_ints in there but just trees. Sure, in 13/12 the problem is 10x less severe than in current trunk, but still we have some cases where we run out of stack because of it on some hosts. Jakub