summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-03-22 16:42:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-02 21:20:07 +0200
commitbe90d26fc60e02c0f8525740b1256ebed37086a0 (patch)
tree55c1e5ed1f81de5943e6a6303ea40a8c9b8c7e8c
parentc9f697a1d0a21afef68b5bba451d0ce2dbdfe03e (diff)
Fix gcc OOM error when compiling in release mode
O3 leads to gcc bailing out with OOM on e.g. MinGW with gcc 4.7.3 onwards. Task-number: QTBUG-29099 Change-Id: I3ce49794fa4857e756d2994454d4144cfb44ce58 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/gui/painting/qdrawhelper.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 0f77ae6d86..61a6f2a5f9 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -40,12 +40,17 @@
****************************************************************************/
#if defined(__OPTIMIZE__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) \
- && (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)
+ && (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__ >= 440)
// GCC 4.4 supports #pragma GCC optimize and #pragma GCC target
-# pragma GCC optimize "O3"
-# if defined(__i386__) && defined(__SSE2__) && !defined(__SSE2_MATH__)
-# pragma GCC target "fpmath=sse"
-# endif
+
+# if (__GNUC__ * 100 + __GNUC_MINOR__ * 10 + __GNUC_PATCHLEVEL__ < 473)
+// From GCC 4.7.3 onwards, GCC optimize can result in gcc bailing out with OOM
+# pragma GCC optimize "O3"
+# endif
+
+# if defined(__i386__) && defined(__SSE2__) && !defined(__SSE2_MATH__)
+# pragma GCC target "fpmath=sse"
+# endif
#endif
#include <qstylehints.h>