6 gfortran bugs

From: Richard E Maine (nospam_at_see.signature)
Date: 01/25/05


Date: Tue, 25 Jan 2005 13:56:18 -0800

Toone, Karl, whoever,

Yes, I know I should submit them through bugzilla. Insert here a flimsy
excuse about not wanting to put my real email address there, combined
with the fascist firewall here blocking me from accessing sneakemail. I
told you it was flimsy; perhaps I'll try to create a bugzilla login from
home. Anyway...

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.

-- 
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain


Relevant Pages

  • Re: Debugging large programs
    ... subroutine or function should also contain argument verification code so ... > There is a logical bug somewhere that is driving me nuts. ... > dominate the binary string. ... One other thing you might do is turn off compiler optimization and see ...
    (comp.lang.fortran)
  • Re: Gfortran 2 years behind G95 and still not ready for prime time
    ... MODE and DIS are subroutine arguments of default (i.e. not ... "modern" Fortran but valid Fortran just the same. ... I'll make sure this is in our bug database. ...
    (comp.lang.fortran)
  • Re: Initialization of Variables
    ... When I stumbled slightly but caught myself long before falling down ... end subroutine dump_bifurc ... end program hw3 ... So that bug has already been fixed. ...
    (comp.lang.fortran)
  • Re: Is this legal Fortran code?
    ... Although it has similarities, the situation is somewhat ... (and so the IBM compiler has a bug). ... I note the inclusion of the apparently unrelated subroutine "a" ... the bug depends on subroutine "a" being there. ...
    (comp.lang.fortran)
  • [EXPL] Improper Input Validation in Bugzilla (Exploit)
    ... Developers can use Bugzilla to keep a commotion list as well ... Text Bug Listing", so we then know file is created. ... * Can edit all aspects of any bug. ... sub generate_chart { ...
    (Securiteam)