https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53296

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
This seems to have morphed into a strange off-by-1
in the array constructor.  Consider this code,

 program chararrerr

   implicit none

   character(len=128) :: str(2)
   str = [ucase("abcde"), ucase("ghij")]

   contains

   function ucase(str)
      character(*) :: str
      character(len(str)) :: ucase
      intent(in) :: str
      ucase = str
      print *, '>' // trim(str) // '<', len(str)
   end function ucase

end program chararrerr

Trunk gives

% gfcx -o z a.f90 -fdump-tree-original && ./z
 >abcde<           5
 >abcde<           5
 >ghij<           4

For some reason, the first element is evaluated twice.

Reply via email to