Undo an optimisation that introduced a bug

I need to figure out an automated way to verify that such races are not introduced.