This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41772] [4.4/4.5 Regression] Wrong code due to TRANSFER of EMPTY array section
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2009 21:16:58 -0000
- Subject: [Bug fortran/41772] [4.4/4.5 Regression] Wrong code due to TRANSFER of EMPTY array section
- References: <bug-41772-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from burnus at gcc dot gnu dot org 2009-10-20 21:16 -------
Reduced testcase. The problem is - as often - the empty array section.
With 4.1, 4.2 and 4.3 it works, while with 4.4 and 4.5 I get a segfault.
module m
implicit none
contains
pure function str_vs(vs) result(s)
character, dimension(:), intent(in) :: vs
character(len=size(vs)) :: s
s = transfer(vs, s)
end function str_vs
subroutine has_key_ns(uri, localname)
character(len=*), intent(in) :: uri, localname
end subroutine
end module m
use m
implicit none
character, dimension(:), pointer :: QName
integer :: n
allocate(qname(6))
qname = (/ 'a','b','c','d','e','f' /)
n = 0
call has_key_ns(str_vs(qname(1:n-1)),"")
deallocate(qname)
end
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.4.1 4.5.0
Known to work| |4.1.3 4.2.1 4.3.4
Summary|segfault due to wrong code |[4.4/4.5 Regression] Wrong
|in TRANSFER? |code due to TRANSFER of
| |EMPTY array section
Target Milestone|--- |4.4.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41772