public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Segmentation fault for the following Fortran program at -O3 on x86-64.
@ 2010-08-05 20:00 Toon Moene
  2010-08-05 20:05 ` Sebastian Pop
  0 siblings, 1 reply; 8+ messages in thread
From: Toon Moene @ 2010-08-05 20:00 UTC (permalink / raw)
  To: gcc mailing list

[-- Attachment #1: Type: text/plain, Size: 3285 bytes --]

The program is attached.

The command line was:

gfortran -c  -O3 inv_dee_main.f

with this gfortran:

Using built-in specs.
COLLECT_GCC=/usr/crz/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/crz/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --enable-checking=release 
--prefix=/usr/crz --disable-multilib --disable-nls --with-arch-64=native 
--with-tune-64=native --enable-languages=fortran,c++ --disable-werror
Thread model: posix
gcc version 4.6.0 20100805 (experimental) (GCC)

gdb backtrace gives:

$ gdb /usr/crz/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/f951
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) run  inv_dee_main.f -ffixed-form -march=core2 -mcx16 -msahf 
--param l1-cache-size=32 --param l1-cache-line-size=64 --param 
l2-cache-size=4096 -mtune=core2 -quiet -dumpbase inv_dee_main.f -auxbase 
inv_dee_main -O3 -version -fintrinsic-modules-path 
/usr/crz/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/finclude -o /tmp/ccpApakj.s
Starting program: 
/usr/crz/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/f951 inv_dee_main.f 
-ffixed-form -march=core2 -mcx16 -msahf --param l1-cache-size=32 --param 
l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=core2 -quiet 
-dumpbase inv_dee_main.f -auxbase inv_dee_main -O3 -version 
-fintrinsic-modules-path 
/usr/crz/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/finclude -o /tmp/ccpApakj.s
GNU Fortran (GCC) version 4.6.0 20100805 (experimental) 
(x86_64-unknown-linux-gnu)
	compiled by GNU C version 4.6.0 20100805 (experimental), GMP version 
4.3.2, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.6.0 20100805 (experimental) 
(x86_64-unknown-linux-gnu)
	compiled by GNU C version 4.6.0 20100805 (experimental), GMP version 
4.3.2, MPFR version 2.4.2, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Program received signal SIGSEGV, Segmentation fault.
find_uses_to_rename_use (bb=0x7f91a552e9c0, use=0x7f91a56e82c0, 
use_blocks=<value optimized out>, need_phis=0x1316ec0) at 
../../gcc/gcc/tree-ssa-loop-manip.c:1242
1242	}
(gdb) where
#0  find_uses_to_rename_use (bb=0x7f91a552e9c0, use=0x7f91a56e82c0, 
use_blocks=<value optimized out>, need_phis=0x1316ec0) at 
../../gcc/gcc/tree-ssa-loop-manip.c:1242
#1  0x0000000000000a00 in ?? ()
#2  0x000000000136d510 in ?? ()
#3  0x0000000001373a50 in ?? ()
#4  0x0000000000000000 in ?? ()

Note that 1242 is the last line of tree-ssa-loop-manip.c - it looks like 
most of the stack has been blown away, and the segmentation fault simply 
happens on return ...

This revision works: 162679
-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran

[-- Attachment #2: inv_dee_main.f --]
[-- Type: text/plain, Size: 18714 bytes --]

      subroutine inv_dee_main
      implicit none
                             INTEGER
     1 JPMXGICL         , JPMXGRCL
     2,JPMXICRL         , JPMXICHL         , JPMXICBL
     3,JPMXICDL         
     4,JPMXOCRL         , JPMXOCHL         , JPMXOCBL
     5,JPMXOCDL         , JPMXDEPL
                             PARAMETER(
     1 JPMXGICL=       1, JPMXGRCL=  2 000 000
     2,JPMXICRL=  164811, JPMXICHL=     581, JPMXICBL=      72
     3,JPMXICDL=    3072
     4,JPMXOCRL=  164811, JPMXOCHL=     581, JPMXOCBL=      72
     5,JPMXOCDL=    3072, JPMXDEPL=     319                   ) 
                             INTEGER
     1 JPMXLID          , JPMXPCD          , JPMXRE1
     2,JPMXRE2          , JPMXDE1          , JPMXDE2
     3,JPMXRBLE         , JPMXDBLE
     4,JPMXRDF          , JPMXDDF          , JPMXADF
     5,JPMXSBI2         , JPMXSMI2         , JPMXSMV
     6,JPMXSMW          , JPMXSMX          , JPMXSMY
     7,JPMXSMA          , JPMXSMB          , JPMXSMC
     8,JPMXSBI1
                             PARAMETER (
     1 JPMXLID =       9, JPMXPCD =      13, JPMXRE1 =      30
     2,JPMXRE2 =      30, JPMXDE1 =      30, JPMXDE2 =      30
     3,JPMXRBLE=      30, JPMXDBLE=      30
     4,JPMXRDF =       5, JPMXDDF =       7, JPMXADF =       7
     5,JPMXSBI2=       5, JPMXSMI2=       4, JPMXSMV =       3
     6,JPMXSMW =       3, JPMXSMX =       5, JPMXSMY =       7
     7,JPMXSMA =       3, JPMXSMB =       3, JPMXSMC =       3
     8,JPMXSBI1=       5                                      )
                             INTEGER
     1 JPMXOTP          , JPMXOCT
     2,JPMXUP           , JPMXAD           , JPMXVAR
     3,JPMXTOCH         , JPMXSSCH
     4,JPXTSL           , JPXCMA
     5,JPXSATS
                             PARAMETER (
     1 JPMXOTP =      10, JPMXOCT =      11
     2,JPMXUP  =      10, JPMXAD  =      20, JPMXVAR =      68
     3,JPMXTOCH=      27, JPMXSSCH=       7
     4,JPXTSL  =      25, JPXCMA  =       1
     5,JPXSATS =       6                                       )
       INTEGER          NOOBST  ,NO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A1,NRARA1SQ
      integer
     $     novarib,nvnumb
                             COMMON/YOMVNMB/
     1 NOVARIB ,NVNUMB(JPMXVAR)
      integer
     1 NMXPPCD ,NPRESCD
     2,NMXLID
     3,NPRESVC ,NHEIGVC           ,NTOVCVC ,NSCACVC
     4,NMXSBI1 ,NSBI1   ,NMXSBI2 ,NSBI2I2 
     5,NMXSMI2 ,NSMI2I2 
     6,NMXSMVV ,NSMVV  
     7,NMXSMWW ,NSMWW  
     8,NMXSMXX ,NSMXX  
     9,NMXSMYY ,NSMYY  
     1,NMXSMAA ,NSMAA  
     2,NMXSMBB ,NSMBB  
     3,NMXSMCC ,NSMCC 
     4,NINTESC ,NREALSC           ,NCHARSC
                             COMMON/YOMNMCOD/
     1 NMXPPCD ,NPRESCD (JPMXPCD )
     2,NMXLID
     3,NPRESVC ,NHEIGVC           ,NTOVCVC ,NSCACVC
     4,NMXSBI1 ,NSBI1   (JPMXSBI1),NMXSBI2 ,NSBI2I2 (JPMXSBI2)
     5,NMXSMI2 ,NSMI2I2 (JPMXSMI2)
     6,NMXSMVV ,NSMVV   (JPMXSMV )
     7,NMXSMWW ,NSMWW   (JPMXSMW )
     8,NMXSMXX ,NSMXX   (JPMXSMX )
     9,NMXSMYY ,NSMYY   (JPMXSMY )
     1,NMXSMAA ,NSMAA   (JPMXSMA )
     2,NMXSMBB ,NSMBB   (JPMXSMB )
     3,NMXSMCC ,NSMCC   (JPMXSMC )
     4,NINTESC ,NREALSC           ,NCHARSC
      logical 
     $     lsynop,lsynopz,
     $     lship,lshipz,
     $     lairep,lairept,lairepu,lairepv,
     $     ldribu,ldribuz,
     $     ltemp,ltempt,ltempu,ltempv,
     $     lpilot,lpilotu,lpilotv,
     $     lsubdom,lthin
      character*100 cmafile
      integer plen,nxdom,nydom
      namelist/clcnam/
     $     lsynop,lsynopz,
     $     lship,lshipz,
     $     lairep,lairept,lairepu,lairepv,
     $     ldribu,ldribuz,
     $     ltemp,ltempt,ltempu,ltempv,
     $     lpilot,lpilotu,lpilotv,
     $     lsubdom,
     $     plen,nxdom,nydom,cmafile
      real,allocatable :: pcma(:)
      integer len,iunit
      integer i,j
      integer ngbgps
      parameter (ngbgps=31)
      real dlon,dlat,splon,splat,south,west
      integer nxfirst,nyfirst,nx,ny,idom
      integer numlev,numoblev,numsurf
      parameter(numlev=3,numoblev=1000,numsurf=1000)
      real preslev(numlev)
      integer ihor,iver,ixe,iye
      integer i_otyp(numoblev,numlev),i_vtyp(numoblev,numlev),
     $        i_xobs(numoblev,numlev),i_yobs(numoblev,numlev),
     $        i_lev(numoblev,numlev),i_styp(numoblev,numlev),
     $        i_sdom(numoblev),
     $        i_numob
      real i_ino(numoblev,numlev),i_sigmao(numoblev,numlev),
     $     i_lon(numoblev,numlev),i_lat(numoblev,numlev),
     $     i_ppp(numoblev,numlev)
      logical        l_numob(numoblev,numlev)
      integer surf_otyp(numsurf),surf_vtyp(numsurf),
     $        surf_styp(numsurf),
     $        surf_xobs(numsurf),surf_yobs(numsurf),
     $        surf_lev(numsurf),surf_sdom(numsurf),
     $        surf_numob
      integer count_200,count_500,count_850,isurflim
      real rdistlim
      real surf_ino(numsurf),surf_sigmao(numsurf),
     $     surf_lon(numsurf),surf_lat(numsurf),
     $     surf_ppp(numsurf)
      integer ilev1,ilev2,ilev3
      parameter(ilev1=10,ilev2=20,ilev3=25)
      integer maxlev,nxf,nyf,igrib,nx_grid,ny_grid
      parameter (maxlev=100,nxf=500,nyf=500,igrib=11)
      real gribbuf(nxf,nyf)
      integer nx_grib,ny_grib,nlev_grib,year,month,day,hour,length
      real afull(maxlev),bfull(maxlev)
      integer idum
      integer iunitout,itype,isubtype,kbufl
      integer iret,irednum
      logical lselect,lexists
      real plon,plat,xpos,ypos,frlobspos
      integer totalno,no
      integer nxmax_sub,nymax_sub
      parameter(nxmax_sub=10,nymax_sub=10)
      integer indexx,indexy,
     x        xfirst_sub(nxmax_sub),nx_sub(nxmax_sub),
     x        yfirst_sub(nymax_sub),ny_sub(nymax_sub),
     x        xacc,yacc,rest
             do ixe=1,numoblev
             do iye=1,numlev
                i_otyp(ixe,iye)=0
                i_styp(ixe,iye)=0
                i_vtyp(ixe,iye)=0
                i_sigmao(ixe,iye)=0
                i_xobs(ixe,iye)=0
                i_yobs(ixe,iye)=0
                i_lev(ixe,iye)=0
                i_ino(ixe,iye)=0.
                i_lat(ixe,iye)=0.
                i_lon(ixe,iye)=0.
                i_ppp(ixe,iye)=0.
                i_sdom(ixe)=0
                l_numob(ixe,iye)=.false.
             enddo
             enddo
             i_numob=0
             do ixe=1,numsurf
                surf_otyp(ixe)=0
                surf_styp(ixe)=0
                surf_vtyp(ixe)=0
                surf_sigmao(ixe)=0
                surf_xobs(ixe)=0
                surf_yobs(ixe)=0
                surf_lev(ixe)=0
                surf_ino(ixe)=0.
                surf_lat(ixe)=0.
                surf_lon(ixe)=0.
                surf_ppp(ixe)=0.
                surf_sdom(ixe)=0
             enddo
             surf_numob=1
             isurflim=200
             rdistlim=1.
             irednum=0
      cmafile='ACMA01' 
      lsynop=.true.
      lsynopz=.true.
      lship=.true.
      lshipz=.true.
      lairep=.true.
      lairept=.true.
      lairepu=.true.
      lairepv=.true.
      ldribu=.true.
      ldribuz=.true.
      ltemp=.true.
      ltempt=.true.
      ltempu=.true.
      ltempv=.true.
      lpilot=.true.
      lpilotu=.true.
      lpilotv=.true.
      lsubdom=.false.
      nxdom=1
      nydom=1
      plen=50000000
      iunit=10
      inquire(file='clcnam.dat',exist=lexists)
      if (lexists) then
         open(iunit,file='clcnam.dat')
         read(iunit,clcnam)
         close(iunit)
      endif   
      write(*,clcnam)
      allocate(pcma(plen))
      call setcma(.true.)
      call auxcmaread(cmafile,pcma,plen,len)
      call hgropen(igrib,gribbuf,nxf*nyf)
      call hgetddr(
     $   west,south,dlat,dlon,splon,splat,afull,bfull,
     $   year,month,day,hour,length,nx_grib,ny_grib,nlev_grib)
         call hgread(igrib,105,1,0.0,gribbuf,nx_grib,ny_grib,idum,iret)
      call hgrclos(igrib)
      write(*,*)'Information for grib file fort.igrib'
      write(*,'(A,2F7.2)')'(west,south)=',west,south
      write(*,'(A,2F7.2)')'(dlat,dlon)=',dlat,dlon
      write(*,'(A,2F7.2)')'(splon,splat)=',splon,splat
      write(*,'(A,3I5)')'(nx_grib,ny_grib,nlev_grib)=',
     $     nx_grib,ny_grib,nlev_grib
      if (ltemp) then
        if  (ltempt) then
           call allstat_temp(pcma,plen,len,ntemp,0,255,
     $          .false.,nvnumb(8),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
              if  (ltempu) then
           call allstat_temp(pcma,plen,len,ntemp,0,255,
     $          .false.,nvnumb(2),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
              endif
              if  (ltempv) then
           call allstat_temp(pcma,plen,len,ntemp,0,255,
     $          .false.,nvnumb(2),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
              endif
              endif
                          if  (lpilot) then
              if  (lpilotu) then
           call allstat_temp(pcma,plen,len,npilot,0,255,
     $          .false.,nvnumb(8),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
              if  (lpilotv) then
           call allstat_temp(pcma,plen,len,npilot,0,255,
     $          .false.,nvnumb(3),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
      endif

              if  (lairep) then
              if  (lairept) then
           call allstat_temp(pcma,plen,len,nairep,0,255,
     $          .false.,nvnumb(2),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
              if  (lairepu) then
           call allstat_temp(pcma,plen,len,nairep,0,255,
     $          .false.,nvnumb(2),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
              if  (lairepv) then
           call allstat_temp(pcma,plen,len,nairep,0,255,
     $          .false.,nvnumb(3),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,ilev1,ilev2,ilev3,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $     i_ino,i_otyp,i_vtyp,i_sigmao,i_xobs,i_yobs,i_lev,
     $     numoblev,numlev,i_numob,l_numob,
     $     i_lat,i_lon,i_ppp)
        endif
      endif
      if  (lsynop) then
         if (lsynopz) then
           call allstat_surf(pcma,plen,len,nsynop,0,20,
     $          .false.,nvnumb(3),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,40,ilev2,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $          surf_ino,surf_otyp,surf_styp,surf_vtyp,surf_sigmao,
     $          surf_xobs,surf_yobs,surf_lev,
     $          surf_lat,surf_lon,surf_ppp,
     $          numsurf,surf_numob)
       endif
      endif
      if  (lship) then
         if (lshipz) then
           call allstat_surf(pcma,plen,len,nsynop,21,255,
     $          .false.,nvnumb(3),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,40,ilev2,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $          surf_ino,surf_otyp,surf_styp,surf_vtyp,surf_sigmao,
     $          surf_xobs,surf_yobs,surf_lev,
     $          surf_lat,surf_lon,surf_ppp,
     $          numsurf,surf_numob)
       endif
      endif
      if  (ldribu) then
         if (ldribuz) then
           call allstat_surf(pcma,plen,len,ndribu,21,255,
     $          .false.,nvnumb(3),npresvc,
     $          south,dlat,splat,splon,west,dlon,
     $          nx_grib,ny_grib,nlev_grib,40,ilev2,
     $          gribbuf,afull,bfull,
     $          nxfirst,nyfirst,nx,ny,idom,
     $          surf_ino,surf_otyp,surf_styp,surf_vtyp,surf_sigmao,
     $          surf_xobs,surf_yobs,surf_lev,
     $          surf_lat,surf_lon,surf_ppp,
     $          numsurf,surf_numob)
       endif
      endif
        rest=mod(nx_grib,nxdom)
        write(6,*) 'restx',rest
        xacc=0
      do i=1,nxdom
        xfirst_sub(i)=xacc+1
      if (i.le.rest) then
        nx_sub(i)=xacc+nx_grib/nxdom+1
      else
        nx_sub(i)=xacc+nx_grib/nxdom
      endif
        xacc=nx_sub(i)
      enddo
        rest=mod(ny_grib,nydom)
        write(6,*) 'resty',rest
        yacc=0
       do i=1,nydom
          yfirst_sub(i)=yacc+1
          if (i.le.rest) then
        ny_sub(i)=yacc+ny_grib/nydom+1
      else
        ny_sub(i)=yacc+ny_grib/nydom
      endif
        yacc=ny_sub(i)
      enddo
      write(6,*)'nxdom,nydom',nxdom,nydom
      write(6,*) xfirst_sub(1:3),nx_sub(1:3)
      write(6,*) yfirst_sub(1:3),ny_sub(1:3)
      lthin=.false.
      if (lthin) then
           rdistlim=8.
      call surf_thin(numsurf,surf_numob,irednum,surf_otyp,
     x               surf_styp,surf_vtyp,surf_xobs,
     x               surf_yobs,surf_ino,surf_sigmao,
     x               isurflim,rdistlim)
      endif
      idom=0
      do iye=1,nydom
      do ixe=1,nxdom
       idom=idom+1
      do i=1,i_numob
      do j=1,numlev
      if (l_numob(i,j)) then
        if ((i_xobs(i,j).ge.xfirst_sub(ixe)).and.
     x     (i_xobs(i,j).le.nx_sub(ixe)).and.
     x     (i_yobs(i,j).ge.yfirst_sub(iye)).and.
     x     (i_yobs(i,j).le.ny_sub(iye)))  then
      write(20+idom,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j),
     x                       i_vtyp(i,j),
     x                       i_xobs(i,j),i_yobs(i,j),i_lev(i,j),
     x                       idom,
     x                       i_ppp(i,j),i_lon(i,j),i_lat(i,j),
     x                       i_ino(i,j),i_sigmao(i,j)  
      endif 
      endif 
      enddo
      enddo
      enddo
      enddo
      idom=0
      do iye=1,nydom
      do ixe=1,nxdom
      idom=idom+1
      do i=1,surf_numob
        if ((surf_xobs(i).ge.xfirst_sub(ixe)).and.
     x     (surf_xobs(i).le.nx_sub(ixe)).and.
     x     (surf_yobs(i).ge.yfirst_sub(iye)).and.
     x     (surf_yobs(i).le.ny_sub(iye)))  then
      write(20+idom,'(7I4,F12.2,4F16.10)') surf_otyp(i),
     x                  surf_styp(i),
     x                  surf_vtyp(i),
     x                  surf_xobs(i),surf_yobs(i),40,idom,
     x                  surf_ppp(i),surf_lon(i),surf_lat(i),
     x                  surf_ino(i),surf_sigmao(i)
      endif
      enddo
      enddo
      enddo
      count_200=0
      do i=1,i_numob
      if (l_numob(i,1)) count_200=count_200+1
      enddo
      count_500=0
      do i=1,i_numob
      if (l_numob(i,2)) count_500=count_500+1
      enddo
      count_850=0
      do i=1,i_numob
      if (l_numob(i,3)) count_850=count_850+1
      enddo
      write(6,*) 'number of obs.:',count_200,count_500,
     x                                      count_850,surf_numob
      end


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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 20:00 Segmentation fault for the following Fortran program at -O3 on x86-64 Toon Moene
@ 2010-08-05 20:05 ` Sebastian Pop
  2010-08-05 20:08   ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Pop @ 2010-08-05 20:05 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc mailing list

Toon,
From your backtrace it looks like a problem in LNO.
Please submit a bug report and attach your testcase.

Thanks,
Sebastian

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 20:05 ` Sebastian Pop
@ 2010-08-05 20:08   ` H.J. Lu
  2010-08-05 20:18     ` Sebastian Pop
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2010-08-05 20:08 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: Toon Moene, gcc mailing list

On Thu, Aug 5, 2010 at 12:33 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> Toon,
> From your backtrace it looks like a problem in LNO.
> Please submit a bug report and attach your testcase.
>

I saw

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
==23110== Invalid read of size 8
==23110==    at 0xB7FE2B: gimple_bb (gimple.h:1148)
==23110==    by 0xB8175F: find_uses_to_rename_use (tree-ssa-loop-manip.c:247)
==23110==    by 0xB81888: find_uses_to_rename_stmt (tree-ssa-loop-manip.c:284)
==23110==    by 0xB81A3B: find_uses_to_rename_bb (tree-ssa-loop-manip.c:305)
==23110==    by 0xB81B7E: find_uses_to_rename (tree-ssa-loop-manip.c:331)
==23110==    by 0xB81C4E: rewrite_into_loop_closed_ssa
(tree-ssa-loop-manip.c:391)
==23110==    by 0xAA54E8: ldist_gen (tree-loop-distribution.c:1094)
==23110==    by 0xAA575A: distribute_loop (tree-loop-distribution.c:1167)
==23110==    by 0xAA5809: tree_loop_distribution (tree-loop-distribution.c:1199)
==23110==    by 0x936418: execute_one_pass (passes.c:1564)
==23110==    by 0x936601: execute_pass_list (passes.c:1619)
==23110==    by 0x936622: execute_pass_list (passes.c:1620)
==23110==  Address 0x10 is not stack'd, malloc'd or (recently) free'd
==23110==
inv_dee_main.f: In function ‘inv_dee_main’:
inv_dee_main.f:1:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
==23110==


-- 
H.J.

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 20:08   ` H.J. Lu
@ 2010-08-05 20:18     ` Sebastian Pop
  2010-08-05 20:21       ` Sebastian Pop
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Pop @ 2010-08-05 20:18 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Toon Moene, gcc mailing list

On Thu, Aug 5, 2010 at 15:00, H.J. Lu <hjl.tools@gmail.com> wrote:
> I saw
> ==23110==    by 0xAA5809: tree_loop_distribution (tree-loop-distribution.c:1199)

Mine.

Thanks for running the trace,
Sebastian

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 20:18     ` Sebastian Pop
@ 2010-08-05 20:21       ` Sebastian Pop
  2010-08-05 21:13         ` Sebastian Pop
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Pop @ 2010-08-05 20:21 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Toon Moene, gcc mailing list

I'm delta reducing this.
Toon, have you opened a bug, or do you want me to open the bug report?

Thanks,
Sebastian

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 20:21       ` Sebastian Pop
@ 2010-08-05 21:13         ` Sebastian Pop
  2010-08-05 22:50           ` Sebastian Pop
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Pop @ 2010-08-05 21:13 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Toon Moene, gcc mailing list

On Thu, Aug 5, 2010 at 15:07, Sebastian Pop <sebpop@gmail.com> wrote:
> I'm delta reducing this.

Reduced it looks like this, and it seems like the bug is in the loop
distribution
for memset zero changes.

      parameter(numlev=3,numoblev=1000)
      integer i_otyp(numoblev,numlev), i_styp(numoblev,numlev)
      logical l_numob(numoblev,numlev)
      do ixe=1,numoblev
         do iye=1,numlev
            i_otyp(ixe,iye)=0
            i_styp(ixe,iye)=0
            l_numob(ixe,iye)=.false.
         enddo
      enddo
      do i=1,m
         do j=1,n
            if (l_numob(i,j)) then
               write(20,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j)
            endif
         enddo
      enddo
      end

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 21:13         ` Sebastian Pop
@ 2010-08-05 22:50           ` Sebastian Pop
  2010-08-06 13:01             ` Toon Moene
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Pop @ 2010-08-05 22:50 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Toon Moene, gcc mailing list

On Thu, Aug 5, 2010 at 15:17, Sebastian Pop <sebpop@gmail.com> wrote:
> On Thu, Aug 5, 2010 at 15:07, Sebastian Pop <sebpop@gmail.com> wrote:
>> I'm delta reducing this.
>
> Reduced it looks like this, and it seems like the bug is in the loop
> distribution
> for memset zero changes.
>
>      parameter(numlev=3,numoblev=1000)
>      integer i_otyp(numoblev,numlev), i_styp(numoblev,numlev)
>      logical l_numob(numoblev,numlev)
>      do ixe=1,numoblev
>         do iye=1,numlev
>            i_otyp(ixe,iye)=0
>            i_styp(ixe,iye)=0
>            l_numob(ixe,iye)=.false.
>         enddo
>      enddo
>      do i=1,m
>         do j=1,n
>            if (l_numob(i,j)) then
>               write(20,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j)
>            endif
>         enddo
>      enddo
>      end
>

This is now http://gcc.gnu.org/PR45199

Sebastian

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

* Re: Segmentation fault for the following Fortran program at -O3 on  x86-64.
  2010-08-05 22:50           ` Sebastian Pop
@ 2010-08-06 13:01             ` Toon Moene
  0 siblings, 0 replies; 8+ messages in thread
From: Toon Moene @ 2010-08-06 13:01 UTC (permalink / raw)
  To: Sebastian Pop; +Cc: H.J. Lu, gcc mailing list

Sebastian Pop wrote:

> On Thu, Aug 5, 2010 at 15:17, Sebastian Pop <sebpop@gmail.com> wrote:

>> On Thu, Aug 5, 2010 at 15:07, Sebastian Pop <sebpop@gmail.com> wrote:

>>> I'm delta reducing this.

>> Reduced it looks like this, and it seems like the bug is in the loop
>> distribution
>> for memset zero changes.
>>
>>      parameter(numlev=3,numoblev=1000)
>>      integer i_otyp(numoblev,numlev), i_styp(numoblev,numlev)
>>      logical l_numob(numoblev,numlev)
>>      do ixe=1,numoblev
>>         do iye=1,numlev
>>            i_otyp(ixe,iye)=0
>>            i_styp(ixe,iye)=0
>>            l_numob(ixe,iye)=.false.
>>         enddo
>>      enddo
>>      do i=1,m
>>         do j=1,n
>>            if (l_numob(i,j)) then
>>               write(20,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j)
>>            endif
>>         enddo
>>      enddo
>>      end
>>
> 
> This is now http://gcc.gnu.org/PR45199

Thanks for picking up the ball where I dropped it.  I was so tired 
yesterday that I couldn't wrap my head around reducing the example anymore.

Cheers,

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran

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

end of thread, other threads:[~2010-08-06 12:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-05 20:00 Segmentation fault for the following Fortran program at -O3 on x86-64 Toon Moene
2010-08-05 20:05 ` Sebastian Pop
2010-08-05 20:08   ` H.J. Lu
2010-08-05 20:18     ` Sebastian Pop
2010-08-05 20:21       ` Sebastian Pop
2010-08-05 21:13         ` Sebastian Pop
2010-08-05 22:50           ` Sebastian Pop
2010-08-06 13:01             ` Toon Moene

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).