ICE with gcc version 4.3.0 20070606 (experimental) on where( ) with complex
array; worked fine previously up until at least gcc version 4.3.0 20070111.

Here is test case (taken from other code) with compiler info and messages
embedded:

      module bug_test

! > gfortran -v
! Using built-in specs.
! Target: i386-pc-linux-gnu
! Configured with: /home/fxcoudert/gfortran_nightbuild/trunk/configure
! -prefix=/home/fxcoudert/gfortran_nightbuild/irun-20070606
! --enable-languages=c,fortran --build=i386-pc-linux-gnu
! --enable-checking=release 
! -with-gmp=/home/fxcoudert/gfortran_nightbuild/software
! Thread model: posix
! gcc version 4.3.0 20070606 (experimental)

! gfortran -O3 -ffree-form -c bug.f
!
! bug.f: In function ‘bug’:
! bug.f:5: internal compiler error: in gfc_conv_constant, at
fortran/trans-const.c:289
! Please submit a full bug report,
! with preprocessed source if appropriate.
! See <URL:http://gcc.gnu.org/bugs.html> for instructions.

! compiles fine with gcc version 4.3.0 20070111 (experimental)
!
! same issue whether in module or not

      contains

      subroutine bug(c)
!     subroutine bug(c,n)

      implicit none

      integer, parameter :: fp = selected_real_kind(13)

!--->    different variants of defining array - all fail for complex
      complex(kind=fp)              :: c(:,:)
!     complex(kind=fp)              :: c(:)
!     integer                       :: n
!     complex(kind=fp)              :: c(1:n)

!     real(kind=fp)                 :: c(:,:)

!--->    get rid of "dirty" zeroes
      where( abs( aimag( c ) ) < 1.e-10_fp )                             &
     &    c = cmplx( real( c , fp ) , 0._fp , fp )
      where( abs( real( c , fp ) ) < 1.e-10_fp )                         &
     &    c = cmplx( 0._fp , aimag( c ) , fp )

!--->    for real values, it works
!     where( abs( c ) < 1.e-10_fp ) c = 0._fp

      return
      end subroutine bug

      end module bug_test


-- 
           Summary: ICE in gfc_conv_constant (where with complex arrays)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: weinert at cmth dot phys dot uwm dot edu
 GCC build triplet: 386-pc-linux-gnu
GCC target triplet: i386-pc-linux-gnu


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

Reply via email to