public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kostikbel at ukr dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/22292] New: ICE and wrong code gen with _mm_loadl_pd/__builtin_ia32_loadlpd Date: Mon, 04 Jul 2005 09:19:00 -0000 [thread overview] Message-ID: <20050704091851.22292.kostikbel@ukr.net> (raw) The following code #include <xmmintrin.h> extern "C" double fadd(double a, double b) { __m128d a1; __m128d b1; __m128d c; double res; _mm_loadl_pd(a1, &a); _mm_loadl_pd(b1, &b); c = _mm_add_sd(a1, b1); _mm_storel_pd(&res, c); return res; } when compiled with CC3 -msse3 -march=prescott -c fadd.C leads to ICE: /usr/local/opt/gcc-3.4.4/lib/gcc/i386-little-freebsd5/3.4.4/include/emmintrin.h: In function `void _mm_storel_pd(double*, double __vector__)': /usr/local/opt/gcc-3.4.4/lib/gcc/i386-little-freebsd5/3.4.4/include/emmintrin.h:959: internal compiler error: in instantiate_virtual_regs_lossage, at function.c:3765 CC3 is deviant% CC3 -v Reading specs from /usr/local/opt/gcc-3.4.4/lib/gcc/i386-little-freebsd5/3.4.4/specs Configured with: ../gcc-3.4.4/configure --prefix=/usr/local/opt/gcc-3.4.4 --enable-shared --enable-threads --with-as=/usr/local/opt/binutils/bin/as --with-ld=/usr/local/opt/binutils/bin/ld --enable-languages=c,c++,f77,objc,ada,java --disable-nls --enable-long-long --host=i386-little-freebsd5 Thread model: posix gcc version 3.4.4 When compiled with deviant% CC3 -msse3 -march=prescott -O -c fadd.C it leads to wrong code: deviant% objdump --disassemble fadd.o ~/work/gcc-xmm fadd.o: file format elf32-i386-freebsd Disassembly of section .text: 00000000 <_Z4fadddd>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 08 sub $0x8,%esp 6: f2 0f 58 c0 addsd %xmm0,%xmm0 a: 66 0f 13 45 f8 movlpd %xmm0,0xfffffff8(%ebp) f: dd 45 f8 fldl 0xfffffff8(%ebp) 12: c9 leave 13: c3 ret Note that arguments of the fadd function are never accessed. gcc 4.0.0 does not ICE without optimization, but with or without -O, it generates wrong code (for -O, the code is identical to gcc 3.4.4). Substitution of _mm_loadl_pd with __builtin_ia32_loadlpd does not change anything. N.B. I do not insert preprocessed file since code snippet that shows problem uses only headers supplied by gcc itself. Also, this problem appears both under 3.4 and 4.0. If needed, I will attach (relatively large) .i files. -- Summary: ICE and wrong code gen with _mm_loadl_pd/__builtin_ia32_loadlpd Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kostikbel at ukr dot net CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-*-freebsd5 GCC host triplet: i386-*-freebsd5 GCC target triplet: i386-*-freebsd5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22292
next reply other threads:[~2005-07-04 9:19 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-07-04 9:19 kostikbel at ukr dot net [this message] 2005-07-04 9:26 ` [Bug c/22292] " pluto at agmk dot net 2005-07-04 9:56 ` [Bug target/22292] " pinskia at gcc dot gnu dot org 2005-07-04 10:01 ` pinskia at gcc dot gnu dot org 2005-07-04 16:05 ` [Bug target/22292] [3.4 Regression] ICE " 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=20050704091851.22292.kostikbel@ukr.net \ --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).