public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y
@ 2021-03-03  7:00 nickpapior at gmail dot com
  2021-03-03  7:00 ` [Bug fortran/99355] " nickpapior at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: nickpapior at gmail dot com @ 2021-03-03  7:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

            Bug ID: 99355
           Summary: -freal-X-real-Y -freal-Z-real-X promotes Z to Y
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickpapior at gmail dot com
  Target Milestone: ---

Created attachment 50291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50291&action=edit
Same as code snippet

I came about this in LAPACK which allows compiling in quad precision.

However, mixed precision algorithms will no longer be mixed precision since
*everything* gets promoted.

See this code snippet (and attached as well):

program test
  real :: r1
  real*4:: r2
  real(4) :: r3
  real(selected_real_kind(p=6)) :: r4

  double precision :: d1
  real*8 :: d2
  real(8) :: d3
  real(kind(1.d0)) :: d4
  real(selected_real_kind(p=15)) :: d5

  print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3),
kind(r4)
  print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3),
kind(d4), kind(d5)
end program test


Here listed with 4 different flag combinations:

#FLAGS = 
       single  4  4  4  4
       double  8  8  8  8  8
#FLAGS = -freal-4-real-8
       single  8  8  8  8
       double  8  8  8  8  8
#FLAGS = -freal-8-real-16
       single  4  4  4  4
       double 16 16 16 16 16
#FLAGS = -freal-8-real-16 -freal-4-real-8 (order doesn't matter)
       single  8 16 16 16
       double 16 16 16 16 16

The first 3 flag combinations works as intended.
The last one behaves bad.

I would have expected 8->16 and 4->8 (without double promotion).

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
@ 2021-03-03  7:00 ` nickpapior at gmail dot com
  2021-03-03  8:31 ` rguenth at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: nickpapior at gmail dot com @ 2021-03-03  7:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #1 from Nick <nickpapior at gmail dot com> ---
Oh, sorry about gcc-version. I checked this for all these gcc, same for all:
4.8.5 4.9.4 5.4.0 6.5.0 7.5.0 8.4.0 9.2.0

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
  2021-03-03  7:00 ` [Bug fortran/99355] " nickpapior at gmail dot com
@ 2021-03-03  8:31 ` rguenth at gcc dot gnu.org
  2021-03-03  9:16 ` nickpapior at gmail dot com
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-03  8:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |10.2.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So you say -freal-8-real-16 -freal-4-real-8 promotes real(4) to real(16). 
Which indeed sounds less than useful but could be a valid reading of the
intended semantics.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
  2021-03-03  7:00 ` [Bug fortran/99355] " nickpapior at gmail dot com
  2021-03-03  8:31 ` rguenth at gcc dot gnu.org
@ 2021-03-03  9:16 ` nickpapior at gmail dot com
  2021-03-03 14:38 ` burnus at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: nickpapior at gmail dot com @ 2021-03-03  9:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #3 from Nick <nickpapior at gmail dot com> ---
Yes, real*4 -> real*16. 

I agree that the option semantics are not clear. However, the documentation
says:

Promote all REAL(KIND=M) entities to REAL(KIND=N) entities. If REAL(KIND=N) is
unavailable, then an error will be issued. All other real kind types are
unaffected by this option. These options should be used with care and may not
be suitable for your codes. Areas of possible concern include calls to external
procedures, alignment in EQUIVALENCE and/or COMMON, generic interfaces, BOZ
literal constant conversion, and I/O. Inspection of the intermediate
representation of the translated Fortran code, produced by
-fdump-tree-original, is suggested.

>From this I read that no *double* promotions are done. However, the text isn't
clear either.

I would just not assume that *everything* gets promoted, especially since there
is a -freal-4-real-16 option, so users can already be explicit.


I guess this also applies to the -finteger-4-integer-8 and friends (untested)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (2 preceding siblings ...)
  2021-03-03  9:16 ` nickpapior at gmail dot com
@ 2021-03-03 14:38 ` burnus at gcc dot gnu.org
  2021-03-03 20:39 ` nickpapior at gmail dot com
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-03 14:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566162.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (3 preceding siblings ...)
  2021-03-03 14:38 ` burnus at gcc dot gnu.org
@ 2021-03-03 20:39 ` nickpapior at gmail dot com
  2021-03-04  7:20 ` cvs-commit at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: nickpapior at gmail dot com @ 2021-03-03 20:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #5 from Nick <nickpapior at gmail dot com> ---
Thanks for the swift action! And lots of tests ;)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (4 preceding siblings ...)
  2021-03-03 20:39 ` nickpapior at gmail dot com
@ 2021-03-04  7:20 ` cvs-commit at gcc dot gnu.org
  2021-03-04  7:20 ` burnus at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-04  7:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:d259ab15761de2d938c24abfba9cdcd2fef91655

commit r11-7501-gd259ab15761de2d938c24abfba9cdcd2fef91655
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Thu Mar 4 08:18:31 2021 +0100

    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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (5 preceding siblings ...)
  2021-03-04  7:20 ` cvs-commit at gcc dot gnu.org
@ 2021-03-04  7:20 ` burnus at gcc dot gnu.org
  2021-03-04 12:02 ` dominiq at lps dot ens.fr
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04  7:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED thanks for the report.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (6 preceding siblings ...)
  2021-03-04  7:20 ` burnus at gcc dot gnu.org
@ 2021-03-04 12:02 ` dominiq at lps dot ens.fr
  2021-03-04 12:37 ` burnus at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-04 12:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=57871
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2021-03-04
     Ever confirmed|0                           |1

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
r11-7501 changed the output of the test in comment O, is this expected?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (7 preceding siblings ...)
  2021-03-04 12:02 ` dominiq at lps dot ens.fr
@ 2021-03-04 12:37 ` burnus at gcc dot gnu.org
  2021-03-04 13:03 ` dominiq at lps dot ens.fr
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04 12:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dominiq at lps dot ens.fr

--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #8)
> r11-7501 changed the output of the test in comment O, is this expected?

r11-7501 is the commit for this PR99355 – thus, the change is expected.

If you think that the new output is now or still wrong, can you elaborate which
output is unexpected?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (8 preceding siblings ...)
  2021-03-04 12:37 ` burnus at gcc dot gnu.org
@ 2021-03-04 13:03 ` dominiq at lps dot ens.fr
  2021-03-04 14:01 ` burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-04 13:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|dominiq at lps dot ens.fr          |

--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
My email address has changed:

dhumieres dot dominique at free dot fr

It is not registered in bugzilla.

% gfc pr57871.f90 
% ./a.out
 kind(1.0_p1)           4 precision(1.0_p1)           6
 kind(1.0_dp)           8 precision(1.0_dp)          15

So without option kind(1.0_p1) is 4, should not it be converted to 16 with
-freal-4-real-16? The other alternative is that -freal-4-real-16 promotes all
real(4) to real(16), then the smallest selected_real_kind(1) will be 8 (as
expected by the reporter), then kind(1.0_p1) will be real(8).

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (9 preceding siblings ...)
  2021-03-04 13:03 ` dominiq at lps dot ens.fr
@ 2021-03-04 14:01 ` burnus at gcc dot gnu.org
  2021-03-04 14:13 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04 14:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #8)
> r11-7501 changed the output of the test in comment O, is this expected?

(In reply to Dominique d'Humieres from comment #10)
> % gfc pr57871.f90

I am slightly confused. Do you mean the output for this PR's comment 0 has
changed – or the result for the testcase in PR 57871 comment 0?

> % ./a.out
>  kind(1.0_p1)           4 precision(1.0_p1)           6
>  kind(1.0_dp)           8 precision(1.0_dp)          15

Using PR 57871 comment 0, I get exactly the same output as you have with both
gfortran and ifort.

 * * *

> So without option kind(1.0_p1) is 4, should not it be converted to 16 with
> -freal-4-real-16?

Currently, the code handles:
  1.0  = default-kind real
  1.0d0 = default-double-precision-kind real
→ promote

And
  real :: A  → default-kind real
  double precision :: B → default-double-precision real
  real*<kind>      :: C → convert <kind>
  real(kind=<kind> :: D → convert <kind>

The question is what to do about:
  1.0_<kind>

  * * *

However, we cannot completely avoid ambiguity as for
-freal-4-real-8 freal-8-real-16

  integer, parameter :: k1 = kind(1.0) → 8
  real(kind=k1) :: var → kind(8) → 16
  real(kind=4)  :: var → kind(4) → 8

But some issues are unavoidable and all -freal-*-real-* flags should be
avoided, if possible.

 * * *

Seems as if we need to handle in match_real_constant the case default-real-kind
separately from _kind value specified.

Untested:

--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -666,6 +666,25 @@ done:
   if (kind == -1)
     goto cleanup;

+  if (kind == 4)
+    {
+      if (flag_real4_kind == 8)
+       kind = 8;
+      if (flag_real4_kind == 10)
+       kind = 10;
+      if (flag_real4_kind == 16)
+       kind = 16;
+    }
+  else if (kind == 8)
+    {
+      if (flag_real8_kind == 4)
+       kind = 4;
+      if (flag_real8_kind == 10)
+       kind = 10;
+      if (flag_real8_kind == 16)
+       kind = 16;
+    }
+
   switch (exp_char)
     {
     case 'd':

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (10 preceding siblings ...)
  2021-03-04 14:01 ` burnus at gcc dot gnu.org
@ 2021-03-04 14:13 ` burnus at gcc dot gnu.org
  2021-03-04 14:41 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04 14:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Additional patch – my need some cleanup & check whether the
other flags agree with the description. However, it should
match the implementation:

--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -519,8 +519,13 @@ representation of the translated Fortran code, produced by
 @opindex @code{freal-8-real-16}
 @cindex options, real kind type promotion
 Promote all @code{REAL(KIND=M)} entities to @code{REAL(KIND=N)} entities.
-If @code{REAL(KIND=N)} is unavailable, then an error will be issued.
-All other real kind types are unaffected by this option.
+If @code{REAL(KIND=N)} is unavailable, then an error will be issued;
+the real-4 flags also affect the default real kind, the real-8 flag also
+the double-precision real kind.  All other real kind types are
+unaffected by this option.  For real literal constants, the promoted
+values are used for the default kinds and a specified kind value is
+promoted to the new value.  Note that when using @code{REAL(KIND=KIND(1.0))}
+the literal is first promoted and then the result is promoted again.
 These options should be used with care and may not be suitable for your
 codes.  Areas of possible concern include calls to external procedures,
 alignment in @code{EQUIVALENCE} and/or @code{COMMON}, generic interfaces,

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (11 preceding siblings ...)
  2021-03-04 14:13 ` burnus at gcc dot gnu.org
@ 2021-03-04 14:41 ` dominiq at lps dot ens.fr
  2021-03-04 16:04 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-04 14:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I have changed the test in pr57871 comment 0 to

implicit none
integer,parameter:: p1 = 4, dp = kind(1d0)
print *,'kind(1.0_4) ',kind(1.0_4),'precision(1.0_4) ',precision(1.0_4)
print *,'kind(1.0_p1)',kind(1.0_p1),'precision(1.0_p1)',precision(1.0_p1)
print *,'kind(1.0_dp)',kind(1.0_dp),'precision(1.0_dp)',precision(1.0_dp)
end

Before r11-7501 (r11-7474) the output with -freal-4-real-16 is

 kind(1.0_4)           16 precision(1.0_4)           33
 kind(1.0_p1)          16 precision(1.0_p1)          33
 kind(1.0_dp)           8 precision(1.0_dp)          15

after (r11-7502) it is

 kind(1.0_4)            4 precision(1.0_4)            6
 kind(1.0_p1)           4 precision(1.0_p1)           6
 kind(1.0_dp)           8 precision(1.0_dp)          15

It is not the result I expect.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (12 preceding siblings ...)
  2021-03-04 14:41 ` dominiq at lps dot ens.fr
@ 2021-03-04 16:04 ` burnus at gcc dot gnu.org
  2021-03-04 16:24 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04 16:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #14 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #13)
> I have changed the test in pr57871 comment 0 to [...]
> It is not the result I expect.

Does the patch of comment 11 produce the expected result?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (13 preceding siblings ...)
  2021-03-04 16:04 ` burnus at gcc dot gnu.org
@ 2021-03-04 16:24 ` dominiq at lps dot ens.fr
  2021-03-04 22:32 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-04 16:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #15 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Does the patch of comment 11 produce the expected result?

Quick test, yes.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (14 preceding siblings ...)
  2021-03-04 16:24 ` dominiq at lps dot ens.fr
@ 2021-03-04 22:32 ` burnus at gcc dot gnu.org
  2021-03-05  9:43 ` cvs-commit at gcc dot gnu.org
  2021-03-05  9:46 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-04 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566301.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (15 preceding siblings ...)
  2021-03-04 22:32 ` burnus at gcc dot gnu.org
@ 2021-03-05  9:43 ` cvs-commit at gcc dot gnu.org
  2021-03-05  9:46 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-05  9:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:80cf2facbbdafed159b326d83f7cf3999c3df8d0

commit r11-7519-g80cf2facbbdafed159b326d83f7cf3999c3df8d0
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 5 10:43:11 2021 +0100

    Fortran: Follow fixes to -freal-{4,8}-real* handling [PR99355,PR57871]

    gcc/fortran/ChangeLog:

            PR fortran/99355
            PR fortran/57871
            * invoke.texi (-freal{4,8}-real-*): Extend description.
            * primary.c (match_real_constant): Also promote real literals
            with '_kind' number.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/real4-10-real8-10.f90: Add check for real literals
            with '_kind' number.
            * gfortran.dg/real4-10-real8-16.f90: Likewise.
            * gfortran.dg/real4-10-real8-4.f90: Likewise.
            * gfortran.dg/real4-10.f90: Likewise.
            * gfortran.dg/real4-16-real8-10.f90: Likewise.
            * gfortran.dg/real4-16-real8-16.f90: Likewise.
            * gfortran.dg/real4-16-real8-4.f90: Likewise.
            * gfortran.dg/real4-16.f90: Likewise.
            * gfortran.dg/real4-8-real8-10.f90: Likewise.
            * gfortran.dg/real4-8-real8-16.f90: Likewise.
            * gfortran.dg/real4-8-real8-4.f90: Likewise.
            * gfortran.dg/real4-8.f90: Likewise.
            * gfortran.dg/real8-10.f90: Likewise.
            * gfortran.dg/real8-16.f90: Likewise.
            * gfortran.dg/real8-4.f90: Likewise.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug fortran/99355] -freal-X-real-Y -freal-Z-real-X promotes Z to Y
  2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
                   ` (16 preceding siblings ...)
  2021-03-05  9:43 ` cvs-commit at gcc dot gnu.org
@ 2021-03-05  9:46 ` burnus at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-05  9:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99355

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #18 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The follow-up issue is now also FIXED :-)

Thanks again for the original report Nick!

And thanks Dominique for spotting the omission! At least the crucial bit of the
PR57871 test is now in the testsuite.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-03-05  9:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03  7:00 [Bug fortran/99355] New: -freal-X-real-Y -freal-Z-real-X promotes Z to Y nickpapior at gmail dot com
2021-03-03  7:00 ` [Bug fortran/99355] " nickpapior at gmail dot com
2021-03-03  8:31 ` rguenth at gcc dot gnu.org
2021-03-03  9:16 ` nickpapior at gmail dot com
2021-03-03 14:38 ` burnus at gcc dot gnu.org
2021-03-03 20:39 ` nickpapior at gmail dot com
2021-03-04  7:20 ` cvs-commit at gcc dot gnu.org
2021-03-04  7:20 ` burnus at gcc dot gnu.org
2021-03-04 12:02 ` dominiq at lps dot ens.fr
2021-03-04 12:37 ` burnus at gcc dot gnu.org
2021-03-04 13:03 ` dominiq at lps dot ens.fr
2021-03-04 14:01 ` burnus at gcc dot gnu.org
2021-03-04 14:13 ` burnus at gcc dot gnu.org
2021-03-04 14:41 ` dominiq at lps dot ens.fr
2021-03-04 16:04 ` burnus at gcc dot gnu.org
2021-03-04 16:24 ` dominiq at lps dot ens.fr
2021-03-04 22:32 ` burnus at gcc dot gnu.org
2021-03-05  9:43 ` cvs-commit at gcc dot gnu.org
2021-03-05  9:46 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).