diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-03-04 08:18:31 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-03-04 08:20:01 +0100 |
commit | d259ab15761de2d938c24abfba9cdcd2fef91655 (patch) | |
tree | b7588bb778d9ae68580c5884ea1e8c2cbf128da8 /gcc/fortran/decl.c | |
parent | f3641ac70eb0ae9f8983b7ddb1660c92439565de (diff) | |
download | gcc-d259ab15761de2d938c24abfba9cdcd2fef91655.zip gcc-d259ab15761de2d938c24abfba9cdcd2fef91655.tar.gz gcc-d259ab15761de2d938c24abfba9cdcd2fef91655.tar.bz2 |
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.
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 7239158..947e4f8 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3066,8 +3066,7 @@ gfc_match_old_kind_spec (gfc_typespec *ts) if (flag_real4_kind == 16) ts->kind = 16; } - - if (ts->kind == 8) + else if (ts->kind == 8) { if (flag_real8_kind == 4) ts->kind = 4; @@ -3246,8 +3245,7 @@ close_brackets: if (flag_real4_kind == 16) ts->kind = 16; } - - if (ts->kind == 8) + else if (ts->kind == 8) { if (flag_real8_kind == 4) ts->kind = 4; |