public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mmsussman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/39995]  New: Open MP compile fails with "internal compiler error"
Date: Fri, 01 May 2009 18:23:00 -0000	[thread overview]
Message-ID: <bug-39995-17662@http.gcc.gnu.org/bugzilla/> (raw)

The following error occurs on more than one system with more than one version
of the compiler!

I am running Ubuntu 8.04.
The output of uname -a is:
Linux ozhp 2.6.24-23-generic #1 SMP Wed Apr 1 21:47:28 UTC 2009 i686 GNU/Linux

Command line: and its output:
\gfortran -v -fopenmp simple.f90 -o junk
Driving: gfortran -v -fopenmp simple.f90 -o junk -lgfortranbegin -lgfortran -lm
-shared-libgcc
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--enable-targets=all --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
 /usr/lib/gcc/i486-linux-gnu/4.2.4/f951 simple.f90 -quiet -dumpbase simple.f90
-mtune=generic -auxbase simple -version -fopenmp -fstack-protector -I
/usr/lib/gcc/i486-linux-gnu/4.2.4/finclude -o /tmp/ccYjCwtk.s
GNU F95 version 4.2.4 (Ubuntu 4.2.4-1ubuntu3) (i486-linux-gnu)
        compiled by GNU C version 4.2.4 (Ubuntu 4.2.4-1ubuntu3).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
simple.f90: In function &#8216;MAIN__&#8217;:
simple.f90:42: internal compiler error: in extract_omp_for_data, at
omp-low.c:161
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>.

The problem seems to be associated with one line in the contain-ed subroutine
"display".  The offending line is noted by a comment.  The subroutine is never
called.

There is just this one file, named "simple.f90".

program life
implicit none
integer, parameter :: r8=selected_real_kind(14),N=20,M=40,screen=6,esc=27
integer, parameter :: steps=1000000
logical, parameter :: doDisplay=.false.
integer :: i,j,step,neighbors,ip1,im1,jp1,jm1,numGliders
character(len=1) :: blank=' ',mark='X'
character(len=1) :: world(0:N-1,0:M-1)
integer          :: iworld(0:N-1,0:M-1)

! initialize (vector statement)
world(:,:)=blank
! set up a glider
numGliders=0
DO j=1,M-4,5
  DO i=0,N-4,5
    world(i:i+2,j-1)=mark
    world(i,j)=mark
    world(i+1,j+1)=mark
    numGliders=numGliders+1
  ENDDO
ENDDO

where(world==mark)
  iworld=1
elsewhere
  iworld=0
endwhere
  print *,'starting with ',numGliders,' gliders.'

do step=1,steps
  world=blank
  !$omp parallel do private(i,jm1,jp1,im1,ip1,neighbors)
  do j=M-1,0,-1
    jm1=modulo(j-1,M)
    jp1=modulo(j+1,M)
    do i=N-1,0,-1
      im1=modulo(i-1,N)
      ip1=modulo(i+1,N)

      neighbors= iworld(im1,jm1)+iworld(im1,j)+iworld(im1,jp1) &
          &    + iworld(i,jm1)  +iworld(i,jp1)                 &
          &    + iworld(ip1,jm1)+iworld(ip1,j)+iworld(ip1,jp1)
      if(iworld(i,j)==0) then
        if(neighbors==3)world(i,j)=mark
      else
        if( neighbors==2 .or. neighbors==3 )world(i,j)=mark
      endif
    enddo
  enddo
  !$omp end parallel do
  where(world==mark)
    iworld=1
  elsewhere
    iworld=0
  endwhere
enddo

  print *,'   ended with ',numGliders,' gliders after',steps,' steps.'

CONTAINS

SUBROUTINE display(A)
IMPLICIT NONE
INTEGER,INTENT(IN) :: A(:,:)
CHARACTER(LEN=40)  :: fmt
CHARACTER(LEN=1),ALLOCATABLE :: Acharac(:,:)

DO i=M,1,-1
! comment out the following statement and the program compiles
  WRITE(screen,fmt)i-1,(Acharac(i,j),j=1,N)
ENDDO

END SUBROUTINE display

end program life


-- 
           Summary: Open MP compile fails with "internal compiler error"
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mmsussman at gmail dot com
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39995


             reply	other threads:[~2009-05-01 18:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01 18:23 mmsussman at gmail dot com [this message]
2009-05-01 18:26 ` [Bug fortran/39995] " mmsussman at gmail dot com
2009-05-01 19:29 ` kargl at gcc dot gnu dot org
2009-05-01 21:39 ` msussman at verizon dot net
2009-05-01 21:50 ` kargl at gcc dot gnu dot org
2009-05-05  8:04 ` [Bug fortran/39995] [4.1/4.2 only] " fxcoudert 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=bug-39995-17662@http.gcc.gnu.org/bugzilla/ \
    --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).