public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/42743] New: Inexplicable error message with constructing SIMD values @ 2010-01-14 12:01 bisqwit at iki dot fi 2010-01-14 12:36 ` [Bug c++/42743] " jwakely dot gcc at gmail dot com 0 siblings, 1 reply; 4+ messages in thread From: bisqwit at iki dot fi @ 2010-01-14 12:01 UTC (permalink / raw) To: gcc-bugs 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/42743] Inexplicable error message with constructing SIMD values 2010-01-14 12:01 [Bug c++/42743] New: Inexplicable error message with constructing SIMD values bisqwit at iki dot fi @ 2010-01-14 12:36 ` jwakely dot gcc at gmail dot com 0 siblings, 0 replies; 4+ messages in thread From: jwakely dot gcc at gmail dot com @ 2010-01-14 12:36 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from jwakely dot gcc at gmail dot com 2010-01-14 12:36 ------- (In reply to comment #0) > vec_t tmp2 = {}; // Causes warnings about uninitialized members in > myvec The warning doesn't smean it's uninitialized, just that there are not initializers present for all members: -Wmissing-field-initializers Warn if a structure's initializer has some fields missing. For example, the following code would cause such a warning, because "x.h" is implicitly zero: struct s { int f, g, h; }; struct s x = { 3, 4 }; You can disable that with -Wno-missing-field-initializers (but that doesn't help for cases where vec_t cannot be aggregate initialized) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42743 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <bug-42743-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c++/42743] Inexplicable error message with constructing SIMD values [not found] <bug-42743-4@http.gcc.gnu.org/bugzilla/> @ 2011-10-15 21:27 ` paolo.carlini at oracle dot com 2021-07-22 18:35 ` pinskia at gcc dot gnu.org 1 sibling, 0 replies; 4+ messages in thread From: paolo.carlini at oracle dot com @ 2011-10-15 21:27 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42743 Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jsm28 at gcc dot gnu.org --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-15 21:26:19 UTC --- The first part of this I also noticed some time ago (and mentioned in another PR): roughly speaking, __m128 doesn't seem default-constructible. Is there something we can do about that? Seems rather weird, naively. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/42743] Inexplicable error message with constructing SIMD values [not found] <bug-42743-4@http.gcc.gnu.org/bugzilla/> 2011-10-15 21:27 ` paolo.carlini at oracle dot com @ 2021-07-22 18:35 ` pinskia at gcc dot gnu.org 1 sibling, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-07-22 18:35 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42743 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.7.0 Keywords| |rejects-valid Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Been fixed since GCC 4.7.0. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-22 18:35 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-01-14 12:01 [Bug c++/42743] New: Inexplicable error message with constructing SIMD values bisqwit at iki dot fi 2010-01-14 12:36 ` [Bug c++/42743] " jwakely dot gcc at gmail dot com [not found] <bug-42743-4@http.gcc.gnu.org/bugzilla/> 2011-10-15 21:27 ` paolo.carlini at oracle dot com 2021-07-22 18:35 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).