]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid compile error on gcc-4.6 (and probably older). 1104/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 10 Jul 2015 11:29:42 +0000 (13:29 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 10 Jul 2015 11:29:42 +0000 (13:29 +0200)
include/deal.II/base/vectorization.h

index 173485bb4188be76f0ccd1c83554fba0a22c3b51..009d39277446f6aa4ef7a213a40864778e7bb9bc 100644 (file)
@@ -1360,12 +1360,14 @@ vectorized_load_and_transpose(const unsigned int      n_entries,
       __m128 u5 = _mm_loadu_ps(in+4*i+offsets[5]);
       __m128 u6 = _mm_loadu_ps(in+4*i+offsets[6]);
       __m128 u7 = _mm_loadu_ps(in+4*i+offsets[7]);
-      __m256 t0 = __m256(), t1 = __m256(), t2 = __m256(), t3 = __m256();
-      t0 = _mm256_insertf128_ps (t0, u0, 0);
+      // To avoid warnings about uninitialized variables, need to initialize
+      // one variable with zero before using it.
+      __m256 t0, t1, t2, t3 = _mm256_set1_ps(0.F);
+      t0 = _mm256_insertf128_ps (t3, u0, 0);
       t0 = _mm256_insertf128_ps (t0, u4, 1);
-      t1 = _mm256_insertf128_ps (t1, u1, 0);
+      t1 = _mm256_insertf128_ps (t3, u1, 0);
       t1 = _mm256_insertf128_ps (t1, u5, 1);
-      t2 = _mm256_insertf128_ps (t2, u2, 0);
+      t2 = _mm256_insertf128_ps (t3, u2, 0);
       t2 = _mm256_insertf128_ps (t2, u6, 1);
       t3 = _mm256_insertf128_ps (t3, u3, 0);
       t3 = _mm256_insertf128_ps (t3, u7, 1);
@@ -1391,12 +1393,12 @@ vectorized_load_and_transpose(const unsigned int      n_entries,
       __m128 u5 = _mm_loadu_ps(in+final_pos+offsets[5]);
       __m128 u6 = _mm_loadu_ps(in+final_pos+offsets[6]);
       __m128 u7 = _mm_loadu_ps(in+final_pos+offsets[7]);
-      __m256 t0 = __m256(), t1 = __m256(), t2 = __m256(), t3 = __m256();
-      t0 = _mm256_insertf128_ps (t0, u0, 0);
+      __m256 t0, t1, t2, t3 = _mm256_set1_ps(0.F);
+      t0 = _mm256_insertf128_ps (t3, u0, 0);
       t0 = _mm256_insertf128_ps (t0, u4, 1);
-      t1 = _mm256_insertf128_ps (t1, u1, 0);
+      t1 = _mm256_insertf128_ps (t3, u1, 0);
       t1 = _mm256_insertf128_ps (t1, u5, 1);
-      t2 = _mm256_insertf128_ps (t2, u2, 0);
+      t2 = _mm256_insertf128_ps (t3, u2, 0);
       t2 = _mm256_insertf128_ps (t2, u6, 1);
       t3 = _mm256_insertf128_ps (t3, u3, 0);
       t3 = _mm256_insertf128_ps (t3, u7, 1);
@@ -1843,6 +1845,7 @@ public:
 #endif
     return *this;
   }
+
   /**
    * Multiplication.
    */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.