On Mon, Oct 22, 2007 at 12:08:02 +0100, Andrew Haley wrote: > Well, that's a big job: you'd have to decide on what a memory model > really should be, and then implement that model.
Wouldn't the following rule of thumb work?: GCC is allowed to inject additional store operations on some execution path only if there are explicit store operations (i.e. issued by the user code if read verbatim). The whole problem will vanish if the last store that GCC adds will be made conditional, like if (there_were_explicit_stores_already) store; When execution do not get to basic blocks that have stores, GCC shouldn't add any. -- Tomash Brechko