This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs-19990824/g77 ICE on x86 with optimization
- To: egcs-bugs at egcs dot cygnus dot com (IPM Return requested) (Receipt notification requested)
- Subject: egcs-19990824/g77 ICE on x86 with optimization
- From: Tim C Prince <Prince_Tim_C at solarturbines dot com>
- Date: 26 Aug 1999 11:16:00 Z
- Alternate-Recipient: Allowed
- Conversion: Allowed
- Disclose-Recipients: Prohibited
- Expiry-Date: 25 Sep 1999 00:00:00 Z
- Original-Encoded-Information-Types: IA5-Text, (2)(6)(1)(12)(0), (2)(16)(840)(1)(113694)(2)(2)(1)(1)
- X400-Content-Type: P2-1988 ( 22 )
- X400-MTS-Identifier: [/c=US/admd= /prmd=Cat/; 37C58491.6E8C.290E.000]
- X400-Originator: Prince_Tim_C@solarturbines.com
- X400-Recipients: non-disclosure;
On both the targets i686-pc-linux-gnu and i586-pc-cygwin32, the
following subroutine produces ICE when compiled with 'g77 -c
-Os -funroll-loops'. The code functions as expected if unrolling is
not invoked, or with a change to an earlier version or different
target architecture. The compilers passed make compare when
built with CFLAGS='-Os -march=pentiumpro'.
Dr. Timothy C. Prince
Consulting Engineer
Solar Turbines, a Caterpillar Company
alternate e-mail: tprince@computer.org
C***********************************************
subroutine stats(stat,x,n)
C***********************************************
C
C UNWEIGHTED STATISTICS: MEAN, STADEV, MIN, MAX, HARMONIC MEAN.
C
C STAT(1)= THE MEAN OF X.
C STAT(2)= THE STANDARD DEVIATION OF THE MEAN OF X.
C STAT(3)= THE MINIMUM OF X.
C STAT(4)= THE MAXIMUM OF X.
C STAT(5)= THE HARMONIC MEAN
C X IS THE ARRAY OF INPUT VALUES.
C n IS THE NUMBER OF INPUT VALUES IN X.
C
C***********************************************
implicitdoubleprecision (a-h,o-z)
CIBM IMPLICIT REAL*8 (A-H,O-Z)
C
dimensionx(n),stat(20)
CLLL. OPTIMIZE LEVEL G
C
call trace('STATS ')
C
do k= 1,9
stat(k)= 0.0
enddo
if(n > 0)then
C CALCULATE MEAN OF X.
s= 0.0
do k= 1,n
s= s+x(k)
enddo
a= s/n
stat(1)= a
C CALCULATE STANDARD DEVIATION OF X.
d= 0.0
u= x(1)
v= x(1)
h= 0.0
do k= 1,n
d= d+(x(k)-a)**2
u= min(u,x(k))
v= max(v,x(k))
if(x(k).ne.0.0)then
h= h+1.0/x(k)
endif
enddo
d= d/n
stat(2)= sqrt(d)
C CALCULATE MINIMUM OF X.
stat(3)= u
C CALCULATE MAXIMUM OF X.
stat(4)= v
C CALCULATE HARMONIC MEAN OF X.
if(h.ne.0.0)then
h= (n)/h
endif
stat(5)= h
endif
call track('STATS ')
return
end