------- Comment #7 from rguenth at gcc dot gnu dot org 2010-08-12 21:49 ------- Slightly reduced testcase, fails at -O1 -msse2:
typedef int __v4si __attribute__ ((__vector_size__ (16))); typedef long long __m128i __attribute__ ((__vector_size__ (16))); __inline __m128i __attribute__((__always_inline__)) _mm_set1_epi32 (int __A) { } extern __m128i foobar(__m128i, int); __inline __m128i __attribute__((__always_inline__)) _mm_slli_epi32 (__m128i __A, int __B) { return foobar (__A, __B); } template<typename T> class Vector { public: inline Vector(__m128i x) : d(x) { } inline Vector(T a) : d(_mm_set1_epi32(a)) { } inline Vector<T> operator<<(int x) const __attribute__((always_inline)); inline bool operator==(const Vector<T> &x) const { } __m128i d; }; template<> inline Vector<int> Vector<int>::operator<<(int x) const { return _mm_slli_epi32(d, x); } template<typename T1> inline void foo(const T1 &) { } class Fail { }; int main() { Vector<int> a(1); if ((a << 2) == (a << 2)) { foo(a << 2); throw Fail(); } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45267