Bug 7723 - Internal compiler error - Pentium3 sse - gcc 3.2
Summary: Internal compiler error - Pentium3 sse - gcc 3.2
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2002-08-26 03:06 UTC by morandini
Modified: 2003-07-25 17:33 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description morandini 2002-08-26 03:06:01 UTC
1)
with this code:
/*-------------------*/
typedef int v4sf __attribute__ ((mode(V4SF)));
int main(void) {
	v4sf a={0.,0.,0.,0.};
	return 0;
};
/*------------------*/

marco@pc-31c:~> gcc -msse -march=pentium3 -mfpmath=sse main1.c: In function `main':
main1.c:5: Internal compiler error in instantiate_virtual_regs_1, at function.c:3972

2)this code is compiled, but the program gives a SIGSEGV. What's wrong?
(binutils  2.13.90.0.4 20020814)
/*------------------*/
typedef int v4sf __attribute__ ((mode(V4SF)));
int main(void) {
	v4sf a={1.,1.,1.,1.};
	v4sf b={2.,2.,2.,2.};
	v4sf c;
	c=__builtin_ia32_addss (a, b);
	return 0;
};
/*----------------*/

Here is the assembly of the second program:
        .file   "main.c"
        .text
        .align 2
.globl main
        .type   main,@function
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $56, %esp
        andl    $-16, %esp
        movl    $0, %eax
        subl    %eax, %esp
        movl    $0x3f800000, -24(%ebp)
        movl    $0x3f800000, -20(%ebp)
        movl    $0x3f800000, -16(%ebp)
        movl    $0x3f800000, -12(%ebp)
        movl    $0x40000000, -40(%ebp)
        movl    $0x40000000, -36(%ebp)
        movl    $0x40000000, -32(%ebp)
        movl    $0x40000000, -28(%ebp)
        movaps  -24(%ebp), %xmm0
        addss   -40(%ebp), %xmm0
        movaps  %xmm0, -56(%ebp)
        movl    $0, %eax
        leave
        ret
.Lfe1:
        .size   main,.Lfe1-main
        .ident  "GCC: (GNU) 3.2"

Release:
gcc version 3.2

Environment:
SuSE Linux 8.0, kernle 2.4.18, dual pentiun 3
gcc -v:
Reading specs from /home2/marco/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../configure --enable-threads=posix --enable-languages=c,c++,f77 --prefix=/home2/marco/local : (reconfigured) ../configure --enable-languages=c,c++,f77 --enable-__cxa_atexit --prefix=/home2/marco/local : (reconfigured) ../configure --enable-languages=c,c++,f77 --enable-__cxa_atexit --prefix=/home2/marco/local
Thread model: posix
gcc version 3.2

How-To-Repeat:
see description
Comment 1 tprince 2002-08-26 05:52:13 UTC
From: Tim Prince <tprince@computer.org>
To: morandini@aero.polimi.it, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c/7723: Internal compiler error - Pentium3 sse - gcc 3.2
Date: Mon, 26 Aug 2002 05:52:13 -0700

 On Monday 26 August 2002 03:01, morandini@aero.polimi.it wrote:
 > >Number:         7723
 > >Category:       c
 > >Synopsis:       Internal compiler error - Pentium3 sse - gcc 3.2
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          ice-on-legal-code
 > 
 > >Description:
 >
 > 1)
 > with this code:
 > /*-------------------*/
 > typedef int v4sf __attribute__ ((mode(V4SF)));
 > int main(void) {
 > 	v4sf a={0.,0.,0.,0.};
 > 	return 0;
 > };
 > /*------------------*/
 >
 > marco@pc-31c:~> gcc -msse -march=pentium3 -mfpmath=sse main1.c: In function
 > `main': main1.c:5: Internal compiler error in instantiate_virtual_regs_1,
 > at function.c:3972
 >
 > 2)this code is compiled, but the program gives a SIGSEGV. What's wrong?
 > (binutils  2.13.90.0.4 20020814)
 > /*------------------*/
 > typedef int v4sf __attribute__ ((mode(V4SF)));
 > int main(void) {
 > 	v4sf a={1.,1.,1.,1.};
 > 	v4sf b={2.,2.,2.,2.};
 > 	v4sf c;
 > 	c=__builtin_ia32_addss (a, b);
 > 	return 0;
 > };
 Some might argue about characterizing this as "legal code."  Perhaps it 
 should be flagged as an error.  gcc doesn't support alignment in main(), so 
 it seems that any code which is not standard C and depends on alignment might 
 not be "legal."
 -- 
 Tim Prince

Comment 2 morandini 2002-08-26 16:19:06 UTC
From: Marco Morandini <morandini@aero.polimi.it>
To: tprince@computer.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7723: Internal compiler error - Pentium3 sse - gcc 3.2
Date: Mon, 26 Aug 2002 16:19:06 +0200

 Tim Prince wrote:
 > On Monday 26 August 2002 03:01, morandini@aero.polimi.it wrote:
 > 
 >>>Number:         7723
 >>>Category:       c
 >>>Synopsis:       Internal compiler error - Pentium3 sse - gcc 3.2
 >>>Confidential:   no
 >>>Severity:       serious
 >>>Priority:       medium
 >>>Responsible:    unassigned
 >>>State:          open
 >>>Class:          ice-on-legal-code
 >>
 >>>Description:
 >>
 >>1)
 >>with this code:
 >>/*-------------------*/
 >>typedef int v4sf __attribute__ ((mode(V4SF)));
 >>int main(void) {
 >>	v4sf a={0.,0.,0.,0.};
 >>	return 0;
 >>};
 >>/*------------------*/
 >>
 >>marco@pc-31c:~> gcc -msse -march=pentium3 -mfpmath=sse main1.c: In function
 >>`main': main1.c:5: Internal compiler error in instantiate_virtual_regs_1,
 >>at function.c:3972
 >>
 >>2)this code is compiled, but the program gives a SIGSEGV. What's wrong?
 >>(binutils  2.13.90.0.4 20020814)
 >>/*------------------*/
 >>typedef int v4sf __attribute__ ((mode(V4SF)));
 >>int main(void) {
 >>	v4sf a={1.,1.,1.,1.};
 >>	v4sf b={2.,2.,2.,2.};
 >>	v4sf c;
 >>	c=__builtin_ia32_addss (a, b);
 >>	return 0;
 >>};
 > 
 > Some might argue about characterizing this as "legal code."  Perhaps it 
 > should be flagged as an error.  gcc doesn't support alignment in main(), so 
 > it seems that any code which is not standard C and depends on alignment might 
 > not be "legal."
 
 
 Opsss.....
 Yes, I do not get the SIGSEGV after moving everything to a function
 (If I understand correctly your answer, but I'm definitely not a
 good programmer)
 
 However, I'm still getting the ICE with this:
 /*-------------------*/
 typedef int v4sf __attribute__ ((mode(V4SF)));
 void dummy(void) {
 	v4sf c={0.,0.,0.,0.};
 	return;
 };
 /*-----------------*/
 
 
 Perhaps I'm simply not smart enough to use SIMD gcc support :(
 

Comment 3 tprince 2002-08-26 22:26:38 UTC
From: Tim Prince <tprince@computer.org>
To: Marco Morandini <morandini@aero.polimi.it>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7723: Internal compiler error - Pentium3 sse - gcc 3.2
Date: Mon, 26 Aug 2002 22:26:38 -0700

 On Monday 26 August 2002 07:19, Marco Morandini wrote:
 > Tim Prince wrote:
 > > On Monday 26 August 2002 03:01, morandini@aero.polimi.it wrote:
 > >>>Number:         7723
 > >>>Category:       c
 > >>>Synopsis:       Internal compiler error - Pentium3 sse - gcc 3.2
 > >>>Confidential:   no
 > >>>Severity:       serious
 > >>>Priority:       medium
 > >>>Responsible:    unassigned
 > >>>State:          open
 > >>>Class:          ice-on-legal-code
 > >>>
 > >>>Description:
 > >>
 > >>1)
 > >>with this code:
 > >>/*-------------------*/
 > >>typedef int v4sf __attribute__ ((mode(V4SF)));
 > >>int main(void) {
 > >>	v4sf a={0.,0.,0.,0.};
 > >>	return 0;
 > >>};
 > >>/*------------------*/
 > >>
 > >>marco@pc-31c:~> gcc -msse -march=pentium3 -mfpmath=sse main1.c: In
 > >> function `main': main1.c:5: Internal compiler error in
 > >> instantiate_virtual_regs_1, at function.c:3972
 > >>
 > >>2)this code is compiled, but the program gives a SIGSEGV. What's wrong?
 > >>(binutils  2.13.90.0.4 20020814)
 > >>/*------------------*/
 > >>typedef int v4sf __attribute__ ((mode(V4SF)));
 > >>int main(void) {
 > >>	v4sf a={1.,1.,1.,1.};
 > >>	v4sf b={2.,2.,2.,2.};
 > >>	v4sf c;
 > >>	c=__builtin_ia32_addss (a, b);
 > >>	return 0;
 > >>};
 > >
 > > Some might argue about characterizing this as "legal code."  Perhaps it
 > > should be flagged as an error.  gcc doesn't support alignment in main(),
 > > so it seems that any code which is not standard C and depends on
 > > alignment might not be "legal."
 >
 > Opsss.....
 > Yes, I do not get the SIGSEGV after moving everything to a function
 > (If I understand correctly your answer, but I'm definitely not a
 > good programmer)
 >
 > However, I'm still getting the ICE with this:
 > /*-------------------*/
 > typedef int v4sf __attribute__ ((mode(V4SF)));
 > void dummy(void) {
 > 	v4sf c={0.,0.,0.,0.};
 > 	return;
 > };
 > /*-----------------*/
 >
 >
 > Perhaps I'm simply not smart enough to use SIMD gcc support :(
 
 -- 
 Tim Prince

Comment 4 Jan Hubicka 2002-10-10 08:43:03 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Fixed the first bug, the second problem is broken runtime not aligning stack, should be solved by gcc 3.2 based distros
Comment 5 Jan Hubicka 2002-10-10 15:07:17 UTC
From: hubicka@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/7723
Date: 10 Oct 2002 15:07:17 -0000

 CVSROOT:	/cvs/gcc
 Module name:	egcs
 Branch: 	gcc-3_2-branch
 Changes by:	hubicka@gcc.gnu.org	2002-10-10 08:07:16
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/i386: i386.c 
 
 Log message:
 	PR target/7723
 	* i386.c (ix86_expand_vector_move): Do not generate const0->mem moves.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.81&r2=1.13152.2.657.2.82
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.368.2.19.2.5&r2=1.368.2.19.2.6
 

Comment 6 Jan Hubicka 2002-10-10 15:10:47 UTC
From: hubicka@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/7723
Date: 10 Oct 2002 15:10:47 -0000

 CVSROOT:	/cvs/gcc
 Module name:	egcs
 Changes by:	hubicka@gcc.gnu.org	2002-10-10 08:10:46
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/i386: i386.c 
 
 Log message:
 	PR target/7723
 	* i386.c (ix86_expand_vector_move): Do not generate const0->mem moves.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.15670&r2=1.15671
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.466&r2=1.467