diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index e72b9ba9683e0a904a18c9be72b4ad338b03ebf8..a29d2037db78a59bb88287b7c0412d755fb14c8e 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -535,7 +535,8 @@ public:
     static inline Int32x4 v_toInt(Float32x4 x) { return _mm_cvttps_epi32(x); }
 
     // pre-VS 2008 doesn't have cast intrinsics, whereas 2008 and later requires it
-#if defined(Q_CC_MSVC) && _MSC_VER < 1500
+    // (same deal with gcc prior to 4.0)
+#if (defined(Q_CC_MSVC) && _MSC_VER < 1500) || (defined(Q_CC_GNU) && __GNUC__ < 4)
     static inline Int32x4 v_greaterOrEqual(Float32x4 a, Float32x4 b)
     {
         union Convert { Int32x4 vi; Float32x4 vf; } convert;