From d88e4edcd548e5bb024e75016c5a3449d103bd8d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 26 Jun 2014 22:59:19 -0700 Subject: Work around ICC bug in brace initializations containing constexpr ICC miscompiles this: struct Inner { int i; constexpr Inner(int i) : i(i) {}}; struct Outer { Inner i; }; const Outer x = { -1 }; (Inner = QBasicAtomicInt; Outer = QtPrivate::RefCount, then again for QListData::Data) We expect x to be placed in read-only memory and require no load-time constructor. ICC unfortunately does not do that. By adding a constexpr constructor to Outer, it starts behaving like we expect it to, but falls apart again if you do "const Outer x[]" (the QArrayData statics). The solution is to probably make the varaibles constexpr too, but that's a job for the development branch. Intel issue Id: 6000056211 Intel bug: DPD200534796 Change-Id: Ie9fb5428106486254b7329403890754f300d58c1 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index dd880d8ede..b12f944357 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -530,7 +530,8 @@ # define Q_COMPILER_NOEXCEPT # endif # if __INTEL_COMPILER >= 1400 -# define Q_COMPILER_CONSTEXPR +// causes issues with QArrayData and QtPrivate::RefCount - Intel issue ID 6000056211, bug DPD200534796 +//# define Q_COMPILER_CONSTEXPR # define Q_COMPILER_DELEGATING_CONSTRUCTORS # define Q_COMPILER_EXPLICIT_OVERRIDES # define Q_COMPILER_NONSTATIC_MEMBER_INIT -- cgit v1.2.3