|
From: Nicholas N. <nj...@cs...> - 2008-03-23 22:47:04
|
On Sun, 23 Mar 2008, Nuno Lopes wrote: >>> > Allow me just a last question: is it safe to replace the 't30 = >>> > LDle:I32(t26)' statement with 't30 = 0x4:I32'? Well in general I would >>> > say it is safe, but I dunno about memory-mapped I/O nor if/how valgrind >>> > handles it. Maybe this can be done in only certain architectures? >> >> Difficult question! I would comment first that it might be worth looking >> at the original code to figure out why the compiler put a store and then >> a load from the same location in the next insn. It might be that the >> second instruction (0x80483DC) is a branch target, maybe the top of a >> loop. > > I see that this doesn't work.. If the ptr point to some allocated memory, > other thread may free() it, the ptr will start pointing to freed memory and > thus following read/writes need to be marked as an error. A lesson in binary translation/instrumentation/optimisation: handling correct programs is much easier than handling bogus programs, for exactly this kind of reason! Nick |