public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17075] New: galgel crashes if compiled with -foptimize-sibling-calls
@ 2004-08-18  9:14 lei at il dot ibm dot com
  2004-08-18 14:31 ` [Bug middle-end/17075] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: lei at il dot ibm dot com @ 2004-08-18  9:14 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-08-23  0:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-18  9:14 [Bug fortran/17075] New: galgel crashes if compiled with -foptimize-sibling-calls lei at il dot ibm dot com
2004-08-18 14:31 ` [Bug middle-end/17075] " pinskia at gcc dot gnu dot org
2004-08-18 15:44 ` [Bug middle-end/17075] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-08-18 15:56 ` steven at gcc dot gnu dot org
2004-08-22 18:47 ` steven at gcc dot gnu dot org
2004-08-22 21:54 ` steven at gcc dot gnu dot org
2004-08-22 22:05 ` [Bug middle-end/17075] [3.5 Regression] miscompilation with tail calls in cfgexpand steven at gcc dot gnu dot org
2004-08-22 22:34 ` rth at gcc dot gnu dot org
2004-08-23  0:03 ` cvs-commit at gcc dot gnu dot org
2004-08-23  0:08 ` rth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).