On amd64 debian gfortran fails (both trunk and recent 4.2 from GFortran wiki):

module materials
   implicit none
   integer,parameter :: dr = kind(1.0d0)
   private
   type md_field
       real(dr),dimension(1:3,1:99) :: realspeed
       real(dr),dimension(1:99) :: mass,kinenergy
   end type md_field
contains


   function getTemperature(x,selector) result(temp)
      type(md_field),intent(in) :: x;
      integer,dimension(:),intent(in),optional :: selector;
      real(kind=dr) :: temp;

! realspeed has wrong dimensions
      print *,min(x % kinenergy,x % realspeed)

   end function getTemperature
end module materials


Output is:
$ gfortran-trunk matbug.F90
matbug.F90: In function ‘gettemperature’:
matbug.F90:12: internal compiler error: in fold_binary, at fold-const.c:8923
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

It's not valid I guess, but gfortran should not fail.


-- 
           Summary: ICE in fold_binary in fold-const.c
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: keinstein_junior at gmx dot net


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

Reply via email to