This is the mail archive of the gcc-patches@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]

Re: [PATCH,fortran]: proposed fix for PR 32732


Hi Chris, hi all,

The gcc/fortran/trans-decl.c part seems to be ok.

However, could you modify the gcc/fortran/trans-expr.c fix such that it
works also in the non BIND(C) case; VALUE is not restricted to Bind(c).

*************************************
program test
  implicit none
  character(len=13) :: chr
  chr =  'Fortran       '
  call sub1(chr)
  if(chr /= 'Fortran       ') call abort()
contains
  subroutine sub1(a)
    character(len=13), VALUE :: a
    a = trim(a)//" rules"
    call sub2(a)        ! WRONG: sub2 (&a, 13);
  end subroutine sub1
  subroutine sub2(a)
    character(len=13), VALUE :: a
    print *, a          ! PRINTS GARBAGE
    if(a /= 'Fortran rules') call abort()
  end subroutine sub2
end program test
*************************************

Do you have actually a SVN account or not yet?

Tobias


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