1 // PR c++/45984 2 // We were getting different canonical types for matching types because 3 // TYPE_ALIGN wasn't propagated to all the variants fast enough. 4 // { dg-options "" } 5 // { dg-additional-options "-Wno-return-type" } 6 7 typedef __SIZE_TYPE__ size_t; 8 enum { chunk_size = 16 }; 9 typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); 10 typedef float __v4sf __attribute__ ((__vector_size__ (16))); 11 struct __attribute__((aligned((16)))) float4_t { 12 typedef float scalar_t; 13 typedef __m128 type_t; 14 typedef float4_t return_type_t; 15 type_t m; 16 inline __attribute__((artificial, gnu_inline, always_inline)) explicit float4_tfloat4_t17 float4_t(scalar_t a) : m(((__m128) (__v4sf) { (a), (a), (a), (a) })) { } 18 inline __attribute__((artificial, gnu_inline, always_inline, pure)) friend 19 return_type_t operator+(float4_t lhs, float4_t rhs) { } 20 }; 21 template<size_t NumChans> class __attribute__((aligned((16)))) chunk_array_t { 22 public: 23 typedef float4_t value_type_t; 24 typedef value_type_t value_array_t[chunk_size/4]; 25 enum { num_scalars = chunk_size, num_values = num_scalars/4 }; chan(size_t c)26 const value_array_t &chan(size_t c) const { } 27 value_type_t operator[](size_t i) const { } 28 }; 29 typedef chunk_array_t<1> chunk_array_mono_t; 30 typedef chunk_array_t<2> chunk_array_stereo_t; 31 class freeverb_stereo_t { process(const chunk_array_stereo_t & __restrict__ src,chunk_array_stereo_t & __restrict__ dst)32 void process(const chunk_array_stereo_t & __restrict__ src, 33 chunk_array_stereo_t & __restrict__ dst) { 34 enum { chunk_size = chunk_array_t<1>::num_values }; 35 chunk_array_mono_t mix; 36 for (size_t i=0; i<chunk_size; ++i) 37 mix[i] = src.chan(0)[i] + src.chan(1)[i]; 38 } 39 }; 40