1 CCC g77 0.5.21 `Actual Bugs':
2 CCC * A code-generation bug afflicts Intel x86 targets when `-O2' is
3 CCC specified compiling, for example, an old version of the `DNRM2'
4 CCC routine. The x87 coprocessor stack is being somewhat mismanaged
5 CCC in cases where assigned `GOTO' and `ASSIGN' are involved.
7 CCC Version 0.5.21 of `g77' contains an initial effort to fix the
8 CCC problem, but this effort is incomplete, and a more complete fix is
9 CCC planned for the next release.
11 C Currently this test fails with (at least) `-O2 -funroll-loops' on
12 C i586-unknown-linux-gnulibc1.
14 C (This is actually an obsolete version of dnrm2 -- consult the
15 c current Netlib BLAS.)
18 double precision a(1:100), dnrm2
22 if (dnrm2(100,a,1) .ne. 0.0) call exit(1)
25 double precision function dnrm2 ( n, dx, incx)
26 integer i, incx, ix, j, n, next
27 double precision dx(1), cutlo, cuthi, hitest, sum, xmax,zero,one
28 data zero, one /0.0d0, 1.0d0/
29 data cutlo, cuthi / 8.232d-11, 1.304d19 /
31 if(n .gt. 0 .and. incx.gt.0) go to 10
38 20 go to next,(30, 50, 70, 110)
39 30 if( dabs(dx(i)) .gt. cutlo) go to 85
42 50 if( dx(i) .eq. zero) go to 200
43 if( dabs(dx(i)) .gt. cutlo) go to 85
49 sum = (sum / dx(i)) / dx(i)
50 105 xmax = dabs(dx(i))
52 70 if( dabs(dx(i)) .gt. cutlo ) go to 75
53 110 if( dabs(dx(i)) .le. xmax ) go to 115
54 sum = one + sum * (xmax / dx(i))**2
57 115 sum = sum + (dx(i)/xmax)**2
59 75 sum = (sum * xmax) * xmax
60 85 hitest = cuthi/float( n )
62 if(dabs(dx(i)) .ge. hitest) go to 100
71 if( ix .le. n ) go to 20
72 dnrm2 = xmax * dsqrt(sum)