Discussion:
[Patch, fortran] PR65677 - Incomplete assignment on deferred-length character variable
Dominique d'Humières
2018-09-30 17:16:13 UTC
Permalink
Hi Paul,

First your patch has been committed with wrong entry: 65667 instead of 65677.

Second, I suspect it is responsible of the following ICE:

% gfc pr72755.f90 -fno-range-check
pr72755.f90:1485:0:

1485 | this%buffer = transfer( c(start:iend), this%buffer )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257

and

% gfc pr64125_db.f90
pr64125_db.f90:20:0:

20 | left%chars = transfer( right, left%chars )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257

for

module test
type t_string
private
character(len=:), allocatable :: chars
end type t_string

contains

pure subroutine string_assign_from_array( left, right )

! The target string
type(t_string), intent(out) :: left

! The source string
character, dimension(:), intent(in) :: right


! Copy memory
allocate( character(len=size(right)) :: left%chars )
left%chars = transfer( right, left%chars )

end subroutine string_assign_from_array

end module test

Cheers,

Dominique
Paul Richard Thomas
2018-10-01 07:54:48 UTC
Permalink
Hi Dominique,

I seem to have got the wrong PR number right from the moment that I
created the directory for it and kept copying it thereafter -
apologies, I will put it right.

As to the regression, the fix is simple and is attached. I had quite
forgotten about that assertion, which I am not very convinced is
necessary.

Many thanks for alerting me to these problems.

Paul
Post by Dominique d'Humières
Hi Paul,
First your patch has been committed with wrong entry: 65667 instead of 65677.
% gfc pr72755.f90 -fno-range-check
1485 | this%buffer = transfer( c(start:iend), this%buffer )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257
and
% gfc pr64125_db.f90
20 | left%chars = transfer( right, left%chars )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257
for
module test
type t_string
private
character(len=:), allocatable :: chars
end type t_string
contains
pure subroutine string_assign_from_array( left, right )
! The target string
type(t_string), intent(out) :: left
! The source string
character, dimension(:), intent(in) :: right
! Copy memory
allocate( character(len=size(right)) :: left%chars )
left%chars = transfer( right, left%chars )
end subroutine string_assign_from_array
end module test
Cheers,
Dominique
--
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein
Paul Richard Thomas
2018-10-01 10:18:47 UTC
Permalink
The attached fix breaks the very thing that I set out to fix in the
first place. I'm working on it.

Paul
On Mon, 1 Oct 2018 at 08:54, Paul Richard Thomas
Post by Paul Richard Thomas
Hi Dominique,
I seem to have got the wrong PR number right from the moment that I
created the directory for it and kept copying it thereafter -
apologies, I will put it right.
As to the regression, the fix is simple and is attached. I had quite
forgotten about that assertion, which I am not very convinced is
necessary.
Many thanks for alerting me to these problems.
Paul
Post by Dominique d'Humières
Hi Paul,
First your patch has been committed with wrong entry: 65667 instead of 65677.
% gfc pr72755.f90 -fno-range-check
1485 | this%buffer = transfer( c(start:iend), this%buffer )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257
and
% gfc pr64125_db.f90
20 | left%chars = transfer( right, left%chars )
|
internal compiler error: in gfc_dep_resolver, at fortran/dependency.c:2257
for
module test
type t_string
private
character(len=:), allocatable :: chars
end type t_string
contains
pure subroutine string_assign_from_array( left, right )
! The target string
type(t_string), intent(out) :: left
! The source string
character, dimension(:), intent(in) :: right
! Copy memory
allocate( character(len=size(right)) :: left%chars )
left%chars = transfer( right, left%chars )
end subroutine string_assign_from_array
end module test
Cheers,
Dominique
--
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein
--
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein
Loading...