Bug 8281 - [3.2 regression] [Sparc] ICE when compiling with -O2 -fPIC for Ultrasparc
[3.2 regression] [Sparc] ICE when compiling with -O2 -fPIC for Ultrasparc
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c
3.2.1
: P3 normal
: ---
Assigned To: Eric Botcazou
: ice-on-valid-code
: 7151 8654 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-18 18:16 UTC by yasuaki
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

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


Attachments
e_pow.i.gz (2.86 KB, application/x-gzip )
2003-05-21 15:16 UTC, yasuaki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yasuaki 2002-10-18 18:16:02 UTC
PR 7151 was fixed and patch is merged into gcc-3.2 branch in Oct 1.
But another(?) error happens at the same place.

gcc -o e_pow.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DOJI   -I../../../dist/include/js -I../../../dist/include -I/home/yasuaki/Down/com/mozilla/mozilla/dist/include/nspr      -I/usr/openwin/include   -fPIC -I/usr/openwin/include -Wno-long-long -pthreads  -DNDEBUG -DTRIMMED -O2 -D_IEEE_LIBM  -I/usr/openwin/include -include ../../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/e_pow.pp e_pow.c
e_pow.c: In function `__ieee754_pow':
e_pow.c:376: internal error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Release:
gcc-cvs 3.2.1 prerelease 20021018

Environment:
SunOS wind 5.9 Generic_112233-02 sun4u sparc SUNW,Sun-Blade-100

[yasuaki@wind yasuaki]$ gcc -v
Reading specs from /usr/local/gcc-cvs/lib/gcc-lib/sparc-sun-solaris2.9/3.2.1/specs
Configured with: ../gcc-cvs/gcc/configure --enable-languages=c,c++ --enable-shared --enable-threads=solaris --with-cpu=ultrasparc --prefix=/usr/local/gcc-cvs
Thread model: solaris
gcc version 3.2.1 20021018 (prerelease)
Comment 1 yasuaki 2002-10-18 18:16:02 UTC
Fix:
Compile -mcpu=supersparc or -O1 will be ok.
Comment 2 Wolfgang Bangerth 2002-11-27 06:21:03 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Christian confirmed this.
Comment 3 Christian Ehrhardt 2002-11-27 14:29:11 UTC
From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, yasuaki@k8.dion.ne.jp,
  gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/8281: Segfault when compiling for ultrasparc
Date: Wed, 27 Nov 2002 14:29:11 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8281
 
 Hi,
 
 I can confirm this on 3.2.1, it seems to be fixed with 3.3. With 3.2 I
 get the following ICE for my reduced testcase:
 
 elbereth$ gcc -O2 -c -fPIC -mcpu=ultrasparc 8281.c 
 8281.c: In function `__ieee754_pow':
 8281.c:43: insn does not satisfy its constraints:
 (insn 249 44 47 (set (reg:DI 36 %f4)
         (reg/v:DI 64 %f32 [110])) 58 {*movdi_insn_sp32_v9} (nil)
     (nil))
 8281.c:43: Internal compiler error in reload_cse_simplify_operands, at reload1.c:8369
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 The reduced testcase (sorry still 43 lines) is below. There's not a
 single line that can be removed without the ice going away. Compile
 with gcc -O2 -c -fPIC -mcpu=ultrasparc.
 
 static const double
 bp = 1.0,
 dp_l[] = { 0.0};
 double __ieee754_pow(double x, double y)
 {
 	union {
 		int lo;
 		double d;
 	}uz;
         double y1,t1,p_h,t,z;
         double z_h,z_l,p_l;
         double t2,r,s,u,v,w;
         int i = 0;
 
         double s_h,t_h;
         double s2,s_l,t_l;
 
 
             v = 1.0/(v+bp);
 	    uz.d = s_h = s = u*v;
             uz.lo = 0;
             s_h = uz.d;
             uz.d = t_h;
 	    uz.lo = 3;
             t_h = uz.d;
             s_l = v*((u-s_h*t_h)-s_h*t_l);
             s2 = s*s;
             r = s2* s2* (1.1+s2*(1.2+s2*(1.3+s2*(1.4+s2*(1.5+s2*1.6)))));
             s2 = s_h*s_h;
             uz.lo = 0;
             t_h = uz.d;
             t_l = r-((t_h-3.0)-s2);
             v = s_l*t_h+t_l*s;
             p_l = v-(p_h-u);
             z_h = bp *p_h;
             z_l = bp*p_h+p_l*1.0+dp_l[i];
             t = (double)i;
             t1 = (((bp+z_l)+bp)+t);
             t2 = z_l-(((t1-t)-bp)-z_h);
         p_l = (y-y1)*t1+y*t2;
         z = p_l+p_h;
         return s*z;
 }
 
 -- 
 THAT'S ALL FOLKS!
Comment 4 Eric Botcazou 2003-03-23 15:59:01 UTC
Responsible-Changed-From-To: unassigned->ebotcazou
Responsible-Changed-Why: Investigating.
Comment 5 Eric Botcazou 2003-03-28 08:25:58 UTC
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/8281
Date: 28 Mar 2003 08:25:58 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-28 08:25:57
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/sparc: sparc.md 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.dg: ultrasp7.c 
 
 Log message:
 	PR c/8281
 	* config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative.
 	(movdi reg/reg split): Match only on sparc32, and v9 when int regs.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.17236&r2=1.17237
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&r1=1.182&r2=1.183
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2551&r2=1.2552
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/ultrasp7.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 6 Eric Botcazou 2003-03-28 08:43:26 UTC
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/8281
Date: 28 Mar 2003 08:43:26 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-28 08:43:25
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/sparc: sparc.md 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.dg: ultrasp7.c 
 
 Log message:
 	PR c/8281
 	* config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative.
 	(movdi reg/reg split): Match only on sparc32, and v9 when int regs.
 
 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.371&r2=1.16114.2.372
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.181.4.1&r2=1.181.4.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.127&r2=1.2261.2.128
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/ultrasp7.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 

Comment 7 Eric Botcazou 2003-03-28 08:55:04 UTC
From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/8281
Date: 28 Mar 2003 08:55:04 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	ebotcazou@gcc.gnu.org	2003-03-28 08:55:04
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/sparc: sparc.md 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.dg: ultrasp7.c 
 
 Log message:
 	PR c/8281
 	* config/sparc/sparc.md (movdi_insn_sp32_v9): Remove 'f-f' alternative.
 	(movdi reg/reg split): Match only on sparc32, and v9 when int regs.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.285&r2=1.13152.2.657.2.286
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.md.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.148.2.15.4.2&r2=1.148.2.15.4.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.119&r2=1.1672.2.166.2.120
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/ultrasp7.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.4.1
 
Comment 8 Eric Botcazou 2003-03-28 08:57:37 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed. See http://gcc.gnu.org/ml/gcc-patches/2003-03/msg02227.html