Fortran: Fix -freal-{4,8}-real* handling [PR99355]
authorTobias Burnus <tobias@codesourcery.com>
Thu, 4 Mar 2021 07:18:31 +0000 (08:18 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Thu, 4 Mar 2021 07:20:01 +0000 (08:20 +0100)
commitd259ab15761de2d938c24abfba9cdcd2fef91655
treeb7588bb778d9ae68580c5884ea1e8c2cbf128da8
parentf3641ac70eb0ae9f8983b7ddb1660c92439565de
Fortran: Fix -freal-{4,8}-real* handling [PR99355]

Avoid chain kind conversion for, e.g., -freal-4-real-8 -freal-8-real-10.
Note that gfc_default_double_kind/gfc_default_double_kind already
honors the -freal flags.

gcc/fortran/ChangeLog:

PR fortran/99355
* decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Avoid
redoing kind conversions.
* primary.c (match_real_constant): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/99355
* gfortran.dg/real4-10-real8-10.f90: New test.
* gfortran.dg/real4-10-real8-16.f90: New test.
* gfortran.dg/real4-10-real8-4.f90: New test.
* gfortran.dg/real4-10.f90: New test.
* gfortran.dg/real4-16-real8-10.f90: New test.
* gfortran.dg/real4-16-real8-16.f90: New test.
* gfortran.dg/real4-16-real8-4.f90: New test.
* gfortran.dg/real4-16.f90: New test.
* gfortran.dg/real4-8-real8-10.f90: New test.
* gfortran.dg/real4-8-real8-16.f90: New test.
* gfortran.dg/real4-8-real8-4.f90: New test.
* gfortran.dg/real4-8.f90: New test.
* gfortran.dg/real8-10.f90: New test.
* gfortran.dg/real8-16.f90: New test.
* gfortran.dg/real8-4.f90: New test.
17 files changed:
gcc/fortran/decl.c
gcc/fortran/primary.c
gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real4-8.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real8-10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real8-16.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/real8-4.f90 [new file with mode: 0644]