mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-14 09:00:11 +08:00
re PR fortran/91717 (ICE on concatenating deferred-length character and character literal)
2019-09-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/91717 * dependency.c (gfc_dep_resolver): Flag identical components and exit with return value 1 if set and no array refs. 2019-09-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/91717 * gfortran.dg/dependency_55.f90 : New test. From-SVN: r275696
This commit is contained in:
parent
e5b3c74bf0
commit
e4dc7c6572
@ -1,3 +1,9 @@
|
||||
2019-09-13 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/91717
|
||||
* dependency.c (gfc_dep_resolver): Flag identical components
|
||||
and exit with return value 1 if set and no array refs.
|
||||
|
||||
2019-09-11 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/91553
|
||||
|
@ -2096,6 +2096,7 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse,
|
||||
int m;
|
||||
gfc_dependency fin_dep;
|
||||
gfc_dependency this_dep;
|
||||
bool same_component = false;
|
||||
|
||||
this_dep = GFC_DEP_ERROR;
|
||||
fin_dep = GFC_DEP_ERROR;
|
||||
@ -2115,6 +2116,8 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse,
|
||||
components. */
|
||||
if (lref->u.c.component != rref->u.c.component)
|
||||
return 0;
|
||||
|
||||
same_component = true;
|
||||
break;
|
||||
|
||||
case REF_SUBSTRING:
|
||||
@ -2280,6 +2283,10 @@ gfc_dep_resolver (gfc_ref *lref, gfc_ref *rref, gfc_reverse *reverse,
|
||||
if (lref || rref)
|
||||
return 1;
|
||||
|
||||
/* This can result from concatenation of assumed length string components. */
|
||||
if (same_component && fin_dep == GFC_DEP_ERROR)
|
||||
return 1;
|
||||
|
||||
/* If we haven't seen any array refs then something went wrong. */
|
||||
gcc_assert (fin_dep != GFC_DEP_ERROR);
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-09-13 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/91717
|
||||
* gfortran.dg/dependency_55.f90 : New test.
|
||||
|
||||
2019-09-12 Uroš Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR tree-optimization/89386
|
||||
|
18
gcc/testsuite/gfortran.dg/dependency_55.f90
Normal file
18
gcc/testsuite/gfortran.dg/dependency_55.f90
Normal file
@ -0,0 +1,18 @@
|
||||
! { dg-do run }
|
||||
!
|
||||
! Test the fix for PR91717 in which the concatenation operation ICEd.
|
||||
!
|
||||
! Contributed by Damian Rouson <damian@sourceryinstitute.org>
|
||||
!
|
||||
type core
|
||||
character (len=:), allocatable :: msg
|
||||
end type
|
||||
|
||||
type(core) :: my_core
|
||||
|
||||
my_core%msg = ""
|
||||
my_core%msg = my_core%msg//"my message is: "
|
||||
my_core%msg = my_core%msg//"Hello!"
|
||||
|
||||
if (my_core%msg .ne. "my message is: Hello!") stop 1
|
||||
end
|
Loading…
Reference in New Issue
Block a user