Merge "Revert^3 "Use DoNotOptimize rather than rely on a volatile."" into main