forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2018-02-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83344 PR fortran/83975 * resolve.c (resolve_assoc_var): Rearrange the logic for the determination of the character length of associate names. If the associate name is missing a length expression or the length expression is not a constant and the target is not a variable, make the associate name allocatable and deferred length. * trans-decl.c (gfc_get_symbol_decl): Null the character length backend_decl for deferred length associate names that are not variables. Set 'length' to gfc_index_zero_node for character associate names, whose character length is a PARM_DECL. 2018-02-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/83344 PR fortran/83975 * gfortran.dg/associate_22.f90: Enable commented out test. * gfortran.dg/associate_36.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257827 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
pault
committed
Feb 19, 2018
1 parent
ddc5a1d
commit ef718f2
Showing
6 changed files
with
73 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
! { dg-do run } | ||
! | ||
! Test the fix for PR83344. | ||
! | ||
! Contributed by <Janne Blomqvist <jb@gcc.gnu.org> | ||
! | ||
program foo | ||
implicit none | ||
character(len=1) a | ||
character(len=2) b | ||
character(len=3) c | ||
a = 'a' | ||
call bah(a, len (a)) | ||
b = 'bb' | ||
call bah(b, len (b)) | ||
c = 'ccc' | ||
call bah(c, len (c)) | ||
contains | ||
subroutine bah(x, clen) | ||
implicit none | ||
integer :: clen | ||
character(len=*), intent(in) :: x | ||
associate(y => x) | ||
if (len(y) .ne. clen) stop 1 | ||
if (y .ne. x) stop 2 | ||
end associate | ||
end subroutine bah | ||
end program foo |