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/32880] New: User operator & allocatable TYPE components: wrong deallocate


The following program comes - as PR 32842 - from Lawrie Schonfeld's
ISO_VARYING_STRING testsuite. Note this bug remains after the patch for PR
32842 has been applied.

The dump shows:

  _gfortran_deallocate (res.chars.data
  op_assign_vs_ch (&res, (char[1:10] *) &char_a[5]{lb: 1 sz: 1}, 1);
  _gfortran_deallocate (res.chars.data
  res = op_concat_vs_ch (&res, (char[1:10] *) &char_a[5]{lb: 1 sz: 1}, 1);

The second deallocate is wrong.

(If you don't have an ISO_VARYING_STRING, you can get it from:
http://www.fortran.com/iso_varying_string.f95 )

program VST28 ! (C) copyright J.L.Schonfelder 1998
  use ISO_VARYING_STRING
  character(len=10) :: char_a
  type(VARYING_STRING) :: res
  char_a = "1234567890"
  res = char_a(5:5)
  res = res//char_a(5:5)
!  if(char(res) /= "55") then
!write(*,'(a,''"'',a,''", '',i0)') 'ERROR:Expect "55", got:',char(res),len(res)
!  end if
end program VST28


-- 
           Summary: User operator & allocatable TYPE components: wrong
                    deallocate
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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