summaryrefslogtreecommitdiff
path: root/smartptr.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-31 10:22:15 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-31 10:22:15 -0400
commitb1085b7384d91fb81e4e66e3bcd57f5900d83984 (patch)
tree2b99d612acfee2da7b09fd41b9d92c861b0ec8b4 /smartptr.h
parent5f2c32af37152da7607c25df82b392597d05a3c9 (diff)
downloadcryptopp-git-b1085b7384d91fb81e4e66e3bcd57f5900d83984.tar.gz
Changed Cygwin to use -O2 instead of -O3 with GCC 4.9 due to crash
Diffstat (limited to 'smartptr.h')
-rw-r--r--smartptr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/smartptr.h b/smartptr.h
index 82937333..057f5213 100644
--- a/smartptr.h
+++ b/smartptr.h
@@ -79,6 +79,12 @@ public:
T *old_p = m_p;
m_p = 0;
return old_p;
+
+#ifdef __GNUC__
+ // From Andrew Haley (GCC Dev), to tame the optimizer so the assignment is always performed.
+ // See "Disable optimizations in one function" on the GCC mailing list.
+ asm volatile ("" : : : "memory");
+#endif
}
void reset(T *p = 0);