public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lei at il dot ibm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/17075] New: galgel crashes if compiled with -foptimize-sibling-calls
Date: Wed, 18 Aug 2004 09:14:00 -0000	[thread overview]
Message-ID: <20040818091442.17075.lei@il.ibm.com> (raw)

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


             reply	other threads:[~2004-08-18  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18  9:14 lei at il dot ibm dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040818091442.17075.lei@il.ibm.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).