Bug 19690 - ICE with -O3 -march=athlon-xp -mfpmath=sse -mno-80387
Summary: ICE with -O3 -march=athlon-xp -mfpmath=sse -mno-80387
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Richard Henderson
URL:
Keywords: ice-on-valid-code, ssemmx
Depends on:
Blocks:
 
Reported: 2005-01-29 09:09 UTC by Thomas Koenig
Modified: 2005-01-30 04:41 UTC (History)
2 users (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-01-30 02:46:18


Attachments
Failing preprocessed C source code (1.03 KB, text/plain)
2005-01-29 20:01 UTC, Thomas Koenig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Koenig 2005-01-29 09:09:01 UTC
This is from a BLAS routine.

gfortran -O3 -g -march=athlon-xp -mfpmath=sse -mno-80387 -c ddot.f
ddot.f: In function 'ddot':
ddot.f:46: error: insn does not satisfy its constraints:
(insn 365 364 366 12 ddot.f:24 (set (reg:DF 21 xmm0 [104])
        (mem:DF (plus:SI (reg/f:SI 6 bp)
                (const_int -120 [0xffffff88])) [0 S8 A8])) 64 {*movdf_nointeger}
(nil)
    (nil))
ddot.f:46: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:391
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ gfortran -v ; gfortran -dumpmachine
Using built-in specs.
Configured with: ../gcc/configure --prefix=/home/ig25 --enable-languages=c,f95
Thread model: posix
gcc version 4.0.0 20050129 (experimental)
i686-pc-linux-gnu
$ cat BLAS/SRC/ddot.f
      double precision function ddot(n,dx,incx,dy,incy)
c
c     forms the dot product of two vectors.
c     uses unrolled loops for increments equal to one.
c     jack dongarra, linpack, 3/11/78.
c     modified 12/3/93, array(1) declarations changed to array(*)
c
      double precision dx(*),dy(*),dtemp
      integer i,incx,incy,ix,iy,m,mp1,n
c
      ddot = 0.0d0
      dtemp = 0.0d0
      if(n.le.0)return
      if(incx.eq.1.and.incy.eq.1)go to 20
c
c        code for unequal increments or equal increments
c          not equal to 1
c
      ix = 1
      iy = 1
      if(incx.lt.0)ix = (-n+1)*incx + 1
      if(incy.lt.0)iy = (-n+1)*incy + 1
      do 10 i = 1,n
        dtemp = dtemp + dx(ix)*dy(iy)
        ix = ix + incx
        iy = iy + incy
   10 continue
      ddot = dtemp
      return
c
c        code for both increments equal to 1
c
c
c        clean-up loop
c
   20 m = mod(n,5)
      if( m .eq. 0 ) go to 40
      do 30 i = 1,m
        dtemp = dtemp + dx(i)*dy(i)
   30 continue
      if( n .lt. 5 ) go to 60
   40 mp1 = m + 1
      do 50 i = mp1,n,5
        dtemp = dtemp + dx(i)*dy(i) + dx(i + 1)*dy(i + 1) +
     *   dx(i + 2)*dy(i + 2) + dx(i + 3)*dy(i + 3) + dx(i + 4)*dy(i + 4)
   50 continue
   60 ddot = dtemp
      return
      end

Line 46 is the '50 continue' line.

        Thomas
Comment 1 Andrew Pinski 2005-01-29 13:14:36 UTC
I should note (I think others have to before) that -mno-80387 *******changes********* the ABI.
Comment 2 Thomas Koenig 2005-01-29 20:01:26 UTC
Created attachment 8103 [details]
Failing preprocessed C source code

To see wether this problem can also be exposed with the C
frontend, I ran the subroutine through f2c and preprocessed it
with "gcc -E".

Still the same error:
$ gcc -O3 -g -march=athlon-xp -mfpmath=sse -mno-80387 ddot.i
ddot.c: In function 'ddot_':
ddot.c:91: error: insn does not satisfy its constraints:
(insn 346 345 347 8 ddot.c:53 (set (reg:DF 21 xmm0 [103])
	(mem:DF (plus:SI (reg/f:SI 6 bp)
		(const_int -128 [0xffffff80])) [0 S8 A8])) 64
{*movdf_nointeger} (nil)
    (nil))
ddot.c:91: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:391
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

so this is indeed independent of the front end.

	Thomas
Comment 3 CVS Commits 2005-01-30 03:15:15 UTC
Subject: Bug 19690

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-01-30 03:14:52

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.md 

Log message:
	PR target/19690
	* config/i386/i386.md (movdf_nointeger, movdf_integer): Fix ordering
	of # and * in constraints.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7329&r2=2.7330
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.md.diff?cvsroot=gcc&r1=1.614&r2=1.615

Comment 4 Richard Henderson 2005-01-30 04:40:26 UTC
Fixed.