[Bug fortran/36112] Bounds-checking on character length not working for array-constructors

d at domob dot eu gcc-bugzilla@gcc.gnu.org
Sat May 3 18:27:00 GMT 2008



------- Comment #4 from d at domob dot eu  2008-05-03 18:26 -------
Now I've been analysing a test looking like:

  test("abc", "foobar", "hello")
contains
  subroutine test(r, s)
    character(len=*) :: r, s
    character(len=128) :: arr(2)
    arr = (/ r, s /)
  end subroutine test
end

Which does not trigger the bounds-error, too.  It seems like the hidden
parameter _s (i.e. s's length) is used as the length of r for everything inside
the array constructor, that is for the bounds-checking runtime check (why it
does not trigger the error) and also for the memcpy call and related stuff.

So far I don't know why this is the case, but hopefully I'll find out later and
fix it...  Of course I'd appreciate any hints ;)


-- 


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



More information about the Gcc-bugs mailing list