2010-07-13  Kai Tietz  <kai.tietz@onevision.com>

        PR/3028674
        * intrin.h (_m_pextrw): Make sure gcc's intrinsic do not
        do havoc.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@2831 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/crt/ChangeLog b/mingw-w64-headers/crt/ChangeLog
index 51fa3c1..12aea5a 100644
--- a/mingw-w64-headers/crt/ChangeLog
+++ b/mingw-w64-headers/crt/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-13  Kai Tietz  <kai.tietz@onevision.com>
+
+	PR/3028674
+	* intrin.h (_m_pextrw): Make sure gcc's intrinsic do not
+	do havoc.
+
 2010-07-10  Ramiro Polla  <ramiro.polla@gmail.com>
 
 	* stdlib.h (strtod): For ISO-C99 use posix version __strtod.
diff --git a/mingw-w64-headers/crt/intrin.h b/mingw-w64-headers/crt/intrin.h
index a97e58a..33cae42 100644
--- a/mingw-w64-headers/crt/intrin.h
+++ b/mingw-w64-headers/crt/intrin.h
@@ -54,6 +54,21 @@
 #endif
 #endif
 
+/* Undefine possible defined macros in gcc's intrinsic.  */
+#pragma push_macro ("_m_pextrw")
+#pragma push_macro ("_lrotl")
+#pragma push_macro ("_lrotr")
+#pragma push_macro ("_rotl")
+#pragma push_macro ("_rotr")
+#pragma push_macro ("_mm_shuffle_ps")
+
+#undef _m_pextrw
+#undef _lrotl
+#undef _lrotr
+#undef _rotl
+#undef _rotr
+#undef _mm_shuffle_ps
+
 #define __MACHINEX64 __MACHINE
 #define __MACHINEARMX __MACHINE
 #define __MACHINECC __MACHINE
@@ -293,10 +308,6 @@
     __MACHINEIA64(__MINGW_EXTENSION __int64 __load128(void *,__int64 *))
     __MACHINEIA64(__MINGW_EXTENSION __int64 __load128_acq(void *,__int64 *))
     __MACHINEZ(void __cdecl longjmp(jmp_buf,int))
-#pragma push_macro ("_lrotl")
-#pragma push_macro ("_lrotr")
-#undef _lrotl
-#undef _lrotr
 #ifdef __x86_64__
     __MACHINE(__MINGW_EXTENSION unsigned long long __cdecl _lrotl(unsigned long long,int))
     __MACHINE(__MINGW_EXTENSION unsigned long long __cdecl _lrotr(unsigned long long,int))
@@ -304,8 +315,6 @@
     __MACHINE(unsigned long __cdecl _lrotl(unsigned long,int))
     __MACHINE(unsigned long __cdecl _lrotr(unsigned long,int))
 #endif
-#pragma pop_macro ("_lrotl")
-#pragma pop_macro ("_lrotr")
     __MACHINEI(__MINGW_EXTENSION unsigned __int64 __ll_lshift(unsigned __int64,int))
     __MACHINEI(__MINGW_EXTENSION __int64 __ll_rshift(__int64,int))
     __MACHINEIA64(__m64 __m64_czx1l(__m64))
@@ -374,14 +383,8 @@
     __MACHINEIA64(void *_ReturnAddress(void))
     __MACHINESA(void *_ReturnAddress(void))
     __MACHINECE(void *_ReturnAddress(void))
-#pragma push_macro ("_rotl")
-#pragma push_macro ("_rotr")
-#undef _rotl
-#undef _rotr
     __MACHINE(unsigned int __cdecl _rotl(unsigned int,int))
     __MACHINE(unsigned int __cdecl _rotr(unsigned int,int))
-#pragma pop_macro ("_rotr")
-#pragma pop_macro ("_rotl")
 #undef _rotl64
 #undef _rotr64
     __MACHINECE(__MINGW_EXTENSION unsigned __int64 __cdecl _rotl64(unsigned __int64,int))
@@ -582,10 +585,7 @@
     __MACHINEX86X_NOWIN64(__m64 _mm_cvtt_ps2pi(__m128))
     __MACHINEX86X_NOIA64(__m128 _mm_cvt_si2ss(__m128,int))
     __MACHINEX86X_NOWIN64(__m128 _mm_cvt_pi2ps(__m128,__m64))
-#pragma push_macro ("_mm_shuffle_ps")
-#undef _mm_shuffle_ps
     __MACHINEX86X_NOIA64(__m128 _mm_shuffle_ps(__m128,__m128,int const))
-#pragma pop_macro ("_mm_shuffle_ps")
     __MACHINEX86X_NOIA64(__m128 _mm_unpackhi_ps(__m128,__m128))
     __MACHINEX86X_NOIA64(__m128 _mm_unpacklo_ps(__m128,__m128))
     __MACHINEX86X_NOIA64(__m128 _mm_loadh_pi(__m128,__m64 const*))
@@ -1534,6 +1534,14 @@
 #endif
 #endif
 
+/* Restore possibly defined macros by gcc's intrinsic.  */
+#pragma pop_macro ("_lrotl")
+#pragma pop_macro ("_lrotr")
+#pragma pop_macro ("_rotr")
+#pragma pop_macro ("_rotl")
+#pragma pop_macro ("_mm_shuffle_ps")
+#pragma pop_macro ("_m_pextrw")
+
 #if defined(__cplusplus)
 }
 #endif