gfortran exposure to the masses

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Jan 25 22:48:00 GMT 2005


Gang,

Thanks to FX's efforts to produce several binary 
distribution, gfortran is getting more exposure.
The editor of the new standard has just posted 
a short summary of bugs he found with gfortran.

I here reproduce the bugs.  You can read his
comments in c.l.f.  I'll enter these into 
bugzilla sometime this week.

-- 
Steve


All of these are with the 25 Jan nightly Linux build of gfortran,
running on 32-bit SuSE 9.1.

I was hit by gcc bug 17298, but that ons is already in bugzilla.

Others I found so far are below. After these, I ran out of steam for a 
while. Getting more painful to patch around all the places these show up 
so that I can try compilations of the modules that depend on the ones 
these were in. IIRC, bugs 5 and 6 below were also in g95, but fixed 
there by now (alas for duplicated effort... I know). G95 compiles and 
runs this code correctly as of last time I checked.

----------------------------
Bug 1.

program stuff
  integer :: i_do
  integer :: i(101) = (/ (i_do, i_do=1,101) /)
  write (*,*) i
end program stuff

bug1.f90: In function 'MAIN__':
bug1.f90:4: internal compiler error: Possible frontend bug: array 
constructor not expanded

Note that it works up to size 100; fails at size 101.

----------------------------
Bug 2.

  subroutine string_comp
    integer, parameter :: map(0:50) = 0
    integer :: i
    i = map(42)
  end subroutine string_comp

 In file bug2.f90:4

    i = map(42)
    1
Error: Incompatible ranks 0 and 1 in assignment at (1)

Note that it works without the parameter attribute.

----------------------------
Bug 3.

module fdas_command
contains
  function lower_case (string) result(result)
    character*(*), intent(in) :: string
    character*(len(string)) :: result
    result = string
    return
  end function lower_case
  subroutine ask_help (topic)
    character*(*), intent(in) :: topic
    character :: topic_tmp*16
    topic_tmp = lower_case(topic)
    return
  end subroutine ask_help
end module fdas_command

bug3.f90: In function 'ask_help':
bug3.f90:3: internal compiler error: in gfc_conv_function_call, at 
fortran/trans-expr.c:1104

----------------------------
Bug 4.

subroutine open_th_read_unc2
  type my_type
    character :: signal_names(10)*16
  end type
  type(my_type) :: gen
  gen%signal_names = ''
  write (*,*) gen%signal_names(:)(1:4)
end subroutine open_th_read_unc2

bug4.f90: In function 'open_th_read_unc2':
bug4.f90:7: internal compiler error: in gfc_conv_constant, at 
fortran/trans-const.c:344

----------------------------
Bug 5.

subroutine close_th_read_unc3
  type :: unc3_ptr_type
    integer, pointer :: unc3
  end type
  type(unc3_ptr_type) :: unc3_ptrs(10)
  allocate(unc3_ptrs(2)%unc3)
  deallocate(unc3_ptrs(2)%unc3)
end subroutine close_th_read_unc3

bug5.f90: In function 'close_th_read_unc3':
bug5.f90:6: internal compiler error: in gfc_conv_descriptor_data, at 
fortran/trans-array.c:181

Interestingly, the allocate is fine; only the deallocate crumps.

----------------------------
Bug 6.

subroutine bug6
  integer(1) :: i = 32
  write (*,*) achar(i)
end

 In file bug6.f90:3

  write (*,*) achar(i)
                   1
Error: Type of argument 'i' in call to 'achar' at (1) should be 
INTEGER(4), not INTEGER(1)

I thought I recalled someone else submitting one like this, but I
can't off-hand find it now.



More information about the Fortran mailing list