On Tue, Aug 16, 2011 at 08:18:48PM +0400, Dmitry Bely wrote: > On Tue, Aug 16, 2011 at 8:10 PM, Richard W.M. Jones wrote: > > > Well it would certainly help if we had a piece of runnable code to > > look at.  The code supplied in the original email contains an infinite > > loop. > > Yes, that was my mistake that I corrected later. The loop should be > > for (; *s != NULL; s++) { > list = wrp_ml_cons(caml_copy_string(*s), list); /* bug! */ > } Well, contrary to what I said earlier, it really does seem like this is undefined C behaviour. Try the attached program, which distills the problem down to something simple. gcc with -O0 and -O2 produces completely different answers, and the assembler output confirms it. Rich. -- Richard Jones Red Hat