Bug 11089

Summary: [3.3/3.4 regression] ICE: instantiate_virtual_regs_lossage while using sse built-ins
Product: gcc Reporter: jamagallon
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P2 Keywords: ice-on-valid-code
Version: 3.3   
Target Milestone: 3.3.1   
Host: i586-mandrake-linux-gnu Target: i586-mandrake-linux-gnu
Build: i586-mandrake-linux-gnu Known to work:
Known to fail: Last reconfirmed: 2003-06-04 16:02:36

Description jamagallon 2003-06-04 15:53:19 UTC
* Error message:

g++ -march=pentium3 -o ss ss.cc
ss.cc: In function `int main(int, char**)':
ss.cc:20: internal compiler error: in instantiate_virtual_regs_lossage, at
function.c:3783
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/> for instructions.
make: *** [ssg] Error 1

* Version:

werewolf:~/bug> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --enable-long-long
--enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --target=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.3 (Mandrake Linux 9.2 3.3-1mdk)

* Code:

typedef void __vr __attribute__((__mode__(__V4SF__)));

struct vector {
        union {
                __vr    v;
                float   f[4];
        };
};

int main(int argc, char** argv)
{
        float   f[4];
        vector  v;

        f[0] = 0; f[1] = 1; f[2] = 2; f[3] = 3;

        v.v = __builtin_ia32_loadups(f);

        return 0;
}

This is a stripped down version of code that built and worked under 3.2.3.
Comment 1 Andrew Pinski 2003-06-04 16:02:36 UTC
I can confirm this on 3.3.1 (20030526) and on the mainline (20030604), and does not 
ICE on 3.2.3.  I can use either c or c++ to reproduce this error (for c I needed to change 
the variable v to be declared with struct in front of vector) and the ICE is in function.c 
which is in the middle-end so moving to middle-end.


tin:~/src/gnu/gcctest>gcc -S pr11089.c -msse
pr11089.c: In function `main':
pr11089.c:20: internal compiler error: in instantiate_virtual_regs_lossage, at 
function.c:3824
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 GCC Commits 2003-06-13 06:13:55 UTC
Subject: Bug 11089

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2003-06-13 06:13:51

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.md 
Added files:
	gcc/testsuite/gcc.dg: i386-sse-4.c 

Log message:
	PR target/11089
	* config/i386/i386.md (sse_movaps): Use an expander to force
	one operand to be a register.
	(sse_movups): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.18186&r2=1.18187
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.468&r2=1.469
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/i386-sse-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 3 GCC Commits 2003-06-13 06:14:47 UTC
Subject: Bug 11089

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	rth@gcc.gnu.org	2003-06-13 06:14:44

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.md 
Added files:
	gcc/testsuite/gcc.dg: i386-sse-4.c 

Log message:
	PR target/11089
	* config/i386/i386.md (sse_movaps): Use an expander to force
	one operand to be a register.
	(sse_movups): Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.578&r2=1.16114.2.579
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.404.2.17&r2=1.404.2.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/i386-sse-4.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1

Comment 4 Richard Henderson 2003-06-13 06:16:46 UTC
http://gcc.gnu.org/ml/gcc-patches/2003-06/msg01394.html