From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28910 invoked by alias); 18 Aug 2004 09:14:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28897 invoked by uid 48); 18 Aug 2004 09:14:53 -0000 Date: Wed, 18 Aug 2004 09:14:00 -0000 From: "lei at il dot ibm dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20040818091442.17075.lei@il.ibm.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/17075] New: galgel crashes if compiled with -foptimize-sibling-calls X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg01769.txt.bz2 List-Id: When SPEC 2000 benchmark 178.galgel is compiled with -O2 option, galgel crashes. This problem is possibly specific to ia32. I was unable to reproduce it on ppc. I don't have a small testcase that reproduces the problem. The problem seems to be with the function DNRM2 inside lapak.f90. If that function is compiled with -O2 -fno-optimize-sibling-calls, galgel works okay. The problem seems to be connected to the call to SQRT. function dnrm2 ( n, dx, incx) real*8 dnrm2 integer i, incx, ix, j, n, next real*8 dx(*), cutlo, cuthi, hitest, sum, xmax,zero,one data zero, one /0.0d0, 1.0d0/ data cutlo, cuthi / 8.232d-11, 1.304d19 / if(n .gt. 0) go to 10 dnrm2 = zero go to 300 10 assign 30 to next sum = zero i = 1 if( incx .lt. 0 )i = (-n+1)*incx + 1 ix = 1 20 go to next,(30, 50, 70, 110) 30 if( dabs(dx(i)) .gt. cutlo) go to 85 assign 50 to next xmax = zero 50 if( dx(i) .eq. zero) go to 200 if( dabs(dx(i)) .gt. cutlo) go to 85 assign 70 to next go to 105 100 continue ix = j assign 110 to next sum = (sum / dx(i)) / dx(i) 105 xmax = dabs(dx(i)) go to 115 70 if( dabs(dx(i)) .gt. cutlo ) go to 75 110 if( dabs(dx(i)) .le. xmax ) go to 115 sum = one + sum * (xmax / dx(i))**2 xmax = dabs(dx(i)) go to 200 115 sum = sum + (dx(i)/xmax)**2 go to 200 75 sum = (sum * xmax) * xmax 85 hitest = cuthi/float( n ) do 95 j = ix,n if(dabs(dx(i)) .ge. hitest) go to 100 sum = sum + dx(i)**2 i = i + incx 95 continue dnrm2 = dsqrt( sum ) go to 300 200 continue ix = ix + 1 i = i + incx if( ix .le. n ) go to 20 dnrm2 = xmax * dsqrt(sum) 300 continue return end -- Summary: galgel crashes if compiled with -foptimize-sibling-calls Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lei at il dot ibm dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17075