From: Victor Stinner Date: Sun, 29 Jan 2012 23:07:43 +0000 (+0100) Subject: Issue #13874: read_null() of faulthandler uses volatile to avoid optimisation X-Git-Tag: v3.3.0a1~281 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2477208c8bb94fe109f46b30d77d60276dfebe2;p=python Issue #13874: read_null() of faulthandler uses volatile to avoid optimisation Clang 3.0 removes "y = *x;" instruction if the optimisation level is 3. --- diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index fcf4d01239..f18bbbc44f 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -943,10 +943,13 @@ faulthandler_unregister_py(PyObject *self, PyObject *args) static PyObject * faulthandler_read_null(PyObject *self, PyObject *args) { - int *x = NULL, y; + volatile int *x; + volatile int y; int release_gil = 0; if (!PyArg_ParseTuple(args, "|i:_read_null", &release_gil)) return NULL; + + x = NULL; if (release_gil) { Py_BEGIN_ALLOW_THREADS y = *x;