This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30224] New: segmentation falut when compiling certain code


gfortran crashes when compiling the attached code

[trob@aqua] /tmp/gfortcrash $ gfortran -c kinds.f90 constants.f90 lorentz.f90
lorentz.f90: In function ?rotation_generic_cs?:
lorentz.f90:775: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

[trob@aqua] /tmp/gfortcrash $ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/fxcoudert/gfortran_nightbuild/trunk/configure
--prefix=/home/fxcoudert/gfortran_nightbuild/irun-20061130
--enable-languages=c,fortran
--with-gmp=/home/fxcoudert/gfortran_nightbuild/software
Thread model: posix
gcc version 4.3.0 20061130 (experimental)


Reduced testcase:
================== lorentz_red.f90 =============================
module lorentz
  implicit none
  public :: rotation

  integer, dimension(3,3,3), parameter :: epsilon_three = &
       & reshape( source = (/ 0, 0,0,  0,0,-1,   0,1,0,&
       &                      0, 0,1,  0,0, 0,  -1,0,0,&
       &                      0,-1,0,  1,0, 0,   0,0,0 /),&
       &          shape = (/3,3,3/) )

  interface rotation
     module procedure rotation_generic_cs
  end interface

contains

  function rotation_generic_cs(cp, sp, n) result(a)
    real :: a
    real, intent(in) :: cp, sp
    real, dimension(3), intent(in) :: n
    integer :: i,j
    a=cp*cp + (1-cp)*n(i)*n(j)  &
         &   - sp*dot_product(epsilon_three(i,j,:), n)
  end function rotation_generic_cs

end module lorentz
=========================================================

[trob@aqua] /tmp/gfortcrash2 $ gfortran -c lorentz_red.f90
lorentz.f90: In function ?rotation_generic_cs?:
lorentz.f90:18: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


Note that changing the order of the calculation produces an "internal compiler
error" instead of a segmentation fault:

================= lorentz_red2.f90 ==========================
module lorentz
  implicit none
  public :: rotation
  integer, dimension(3,3,3), parameter :: epsilon_three = &
       & reshape( source = (/ 0, 0,0,  0,0,-1,   0,1,0,&
       &                      0, 0,1,  0,0, 0,  -1,0,0,&
       &                      0,-1,0,  1,0, 0,   0,0,0 /),&
       &          shape = (/3,3,3/) )

  interface rotation
     module procedure rotation_generic_cs
  end interface

contains

  function rotation_generic_cs(cp, sp, n) result(a)
    real :: a
    real, intent(in) :: cp, sp
    real, dimension(3), intent(in) :: n
    integer :: i,j
    a=  - sp*dot_product(epsilon_three(i,j,:), n) &
      & +  cp*cp + (1-cp)*n(i)*n(j)  
  end function rotation_generic_cs

end module lorentz
=======================================================

[troban@aqua] /tmp/gfortcrash2 $ gfortran -c lorentz_red2.f90
lorentz.f90: In function ?rotation_generic_cs?:
lorentz.f90:17: internal compiler error: in gfc_conv_expr_op, at
fortran/trans-expr.c:1109
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: segmentation falut when compiling certain code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: trumsko at yahoo dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]