diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2024-04-25 06:52:31 +0100 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2024-04-25 06:52:31 +0100 |
commit | 1fd5a07444776d76cdd6a2eee7df0478201197a5 (patch) | |
tree | 3b01bd2af34693e65f6dc681423e04982f9dee79 /gcc/testsuite/gfortran.dg | |
parent | 09680e3ee7d72978b493dd4127ce2e769f96a45e (diff) | |
download | gcc-1fd5a07444776d76cdd6a2eee7df0478201197a5.zip gcc-1fd5a07444776d76cdd6a2eee7df0478201197a5.tar.gz gcc-1fd5a07444776d76cdd6a2eee7df0478201197a5.tar.bz2 |
Fortran: Generate new charlens for shared symbol typespecs [PR89462]
2024-04-25 Paul Thomas <pault@gcc.gnu.org>
Jakub Jelinek <jakub@gcc.gnu.org>
gcc/fortran
PR fortran/89462
* decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
is greater than 1, gfc_new_charlen is called to generate a new
charlen, registered in the symbol namespace.
(variable_decl, enumerator_decl): Set the new argument in the
calls to build_sym.
gcc/testsuite/
PR fortran/89462
* gfortran.dg/pr89462.f90: New test.
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr89462.f90 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr89462.f90 b/gcc/testsuite/gfortran.dg/pr89462.f90 new file mode 100644 index 0000000..b2a4912 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr89462.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-pedantic-errors" } +! Test the fix for PR89462 in which the shared 'cl' field of the typespec +! shared between 'test', 'TR' and 'aTP' caused the compiler to go into an +! infinite loop. +! Contributed by Sergei Trofimovich <slyich@gmail.com> + CHARACTER*1 FUNCTION test(H) ! { dg-warning "Old-style character length" } + CHARACTER*1 test2,TR,aTP ! { dg-warning "Old-style character length" } + ENTRY test2(L) + CALL ttest3(aTP) + test = TR + RETURN + END |