On 11/08/2014 08:05 PM, Eli Zaretskii wrote: >> Date: Sat, 8 Nov 2014 20:58:02 +0100 >> From: Alexander Shukaev >> Cc: 18995@debbugs.gnu.org >> >> Do you understand why -funroll-loops causes the code to fail to work? >> >> Because I cannot. Unless I'm missing something, this sounds like a >> GCC bug. >> >> >> I've no idea. For that we would have to look into generated assembly code, but >> I'd rather leave that for compiler professionals to analyze. Would forward it >> to GCC guys? > > It probably does warrant a GCC bug report. > >> And how about filtering this flag for good as I asked earlier? >> >> CFLAGS := $(filter-out -funroll-loops,$(CFLAGS)) > > What for? It's a perfectly legitimate compiler switch, and should > work here as well, I think. Agreed on not filtering it out. Alexander, does it help to add explicit debug output (say, fprintf to stderr) on each iteration of the loop? If not, can you compare the debug output from the version with -funroll-loops to the one without, to see whether we're making the same sequence of VirtualAlloc calls? If they're the same, maybe it's not the loop that's broken, but the address space layout.