This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/42743] New: Inexplicable error message with constructing SIMD values


This code:

#include <emmintrin.h>

template<typename vec_t>
void x()
{
    vec_t tmp1 = vec_t(); // Works with myvec, causes error with __m128
    vec_t tmp2 = {};      // Causes warnings about uninitialized members in
myvec
    vec_t tmp3;           // This may cause a warning about use of
uninitialized variables if tmp3 is later read-accessed.
}


struct myvec
{
    struct tmp
    {
        float data[2];
    } d;
};
void y()
{
    x<__m128> ();
    x<myvec>   ();
}

Produces this error when vec_t is __m128:
tmp.cc:6: error: can't convert between vector values of different size
And this warning when vec_t is myvec:
tmp.cc:7: warning: missing initializer for member 'myvec::d'

It is my understanding that constructor calls should never be treated as syntax
errors. Is there really no way to write this code so that it causes neither a
compile error or a warning?


-- 
           Summary: Inexplicable error message with constructing SIMD values
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bisqwit at iki dot fi
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42743


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]