On 11 August 2011 14:13, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 08/11/2011 02:40 PM, Peter Maydell wrote: >> We don't change env between the setjmp and longjmp so the compiler >> should not trash it. (Indeed according to Jan in >> http://lists.gnu.org/archive/html/qemu-devel/2011-07/msg00144.html >> -Wclobbered doesn't complain about this code.) > > Then it's a compiler bug, not smartness. Making env volatile (or making a > volatile copy if there is a performance impact) should still be enough to > work around it.
Yes. (It would have to be a volatile copy, I think, env is a function parameter and I don't think you can make those volatile.) https://bugs.launchpad.net/qemu/+bug/823902 includes some discussion of the effects on the test of adding the volatile copy. -- PMM