public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc at povworld dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/27412] New: Incorrect result with sse intrinsic while extracting int Date: Wed, 03 May 2006 23:25:00 -0000 [thread overview] Message-ID: <bug-27412-12618@http.gcc.gnu.org/bugzilla/> (raw) Following code sets a 4 32-bit int sse vector to 1 for all elements and extracts one int out of the vector. g++ returns an incorrect result when compiling with -O2 or -O3 but not with -O1 or -O0 // ----------------------- #include <stdio.h> #include <emmintrin.h> int main() { __m128i ix = _mm_set1_epi32(1); int res = ((int*)&ix)[1]; printf("results: %i\n", res); } // ----------------------- compiled with: $ g++-4.1.0 -O2 -msse2 expected result: 1 actual result: -1209151480 similar misbehavior by gcc-3.4.5 acutal result: 134513897 $ g++-4.1.0 -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --enable-java-awt=gtk --enable-languages=c,c++,java,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.1.0 (Gentoo 4.1.0) -- Summary: Incorrect result with sse intrinsic while extracting int Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gcc at povworld dot org GCC host triplet: i686 linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27412
next reply other threads:[~2006-05-03 23:25 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-05-03 23:25 gcc at povworld dot org [this message] 2006-05-03 23:28 ` [Bug c++/27412] " pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-27412-12618@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).