On 11/8/21 10:05 AM, Martin Liška wrote: > On 9/28/21 22:39, Andrew MacLeod wrote: >> In Theory, modifying the IL should be fine, it happens already in >> places, but its not extensively tested under those conditions yet. > > Hello Andrew. > > I've just tried using a global gimple_ranger and it crashes when loop > unswitching duplicates > some BBs. > > Please try the attached patch for: hey Martin, try using this in your tree.  Since nothing else is using a growing BB right now, I'll let you work with it and see if everything works as expected before checking it in, just in case we need more tweaking.   With this, make RUNTESTFLAGS=dg.exp=loop-unswitch*.c check-gcc runs clean. basically, I tried to grow it by either a factor of 10% for the current BB size when the grow is requested, or some double the needed extra size, or 128... whichever value is "maximum"    That means it shoudnt be asking for tooo much each time, but also not a minimum amount. Im certainly open to suggestion on how much to grow it each time.    Note the vector being grown is ONLY fo the SSA_NAme being asked for.. so it really an on-demand thing just for specific names, in your case, mostly just the switch index. Let me know how this works for you, and if you have any other issues. Andrew