public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/100227] New: write with implicit loop
@ 2021-04-23  8:01 priv123 at hotmail dot fr
  2021-04-23  8:37 ` [Bug fortran/100227] " priv123 at hotmail dot fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: priv123 at hotmail dot fr @ 2021-04-23  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100227
           Summary: write with implicit loop
           Product: gcc
           Version: 8.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: priv123 at hotmail dot fr
  Target Milestone: ---

Created attachment 50657
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50657&action=edit
example code

The code in attachment runs properly with gfortran 6.3.0 with -O1 and with
gfortran 8.3.0 with -O0, but fails with gfortran 8.3.0 with -O1:

+ gfortran --version
GNU Fortran (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ gfortran -Wall -Wextra -O1 pb_write.F90
+ ./a.out
 KO if -O1/gcc8   4.57776182E-41  -773.585938       3.06225753E-41
 OK: add index            1   1.00000000               5   5.00000000          
    9   9.00000000
 OK: rearranged   1.00000000       5.00000000       9.00000000
 OK: two vars     1.00000000       5.00000000       9.00000000

+ gfortran -Wall -Wextra -O0 pb_write.F90
+ ./a.out
 KO if -O1/gcc8   1.00000000       5.00000000       9.00000000
 OK: add index            1   1.00000000               5   5.00000000          
    9   9.00000000
 OK: rearranged   1.00000000       5.00000000       9.00000000
 OK: two vars     1.00000000       5.00000000       9.00000000

As see in bug 86837, it is also ok with -O1 -fno-frontend-optimize.

I'm emitting a new bug since it should have been fixed in 8.2.1 and it seems in
failure with 8.3.0.

I will check and post results with last available docker images to see if it is
fixed after 8.3.0...

Thanks for reading!

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

* [Bug fortran/100227] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
@ 2021-04-23  8:37 ` priv123 at hotmail dot fr
  2021-04-23  9:13 ` [Bug fortran/100227] [8/9/10/11/12 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: priv123 at hotmail dot fr @ 2021-04-23  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

Mathieu <priv123 at hotmail dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |6.3.0
      Known to fail|                            |10.3.0, 9.3.0

--- Comment #1 from Mathieu <priv123 at hotmail dot fr> ---
same problem reproduced with 9.3.0 and 10.3.0 (from docker)

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

* [Bug fortran/100227] [8/9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
  2021-04-23  8:37 ` [Bug fortran/100227] " priv123 at hotmail dot fr
@ 2021-04-23  9:13 ` rguenth at gcc dot gnu.org
  2021-04-23 10:21 ` dominiq at lps dot ens.fr
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-23  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|write with implicit loop    |[8/9/10/11/12 Regression]
                   |                            |write with implicit loop
           Keywords|                            |wrong-code
   Target Milestone|---                         |8.5
           Priority|P3                          |P4

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

* [Bug fortran/100227] [8/9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
  2021-04-23  8:37 ` [Bug fortran/100227] " priv123 at hotmail dot fr
  2021-04-23  9:13 ` [Bug fortran/100227] [8/9/10/11/12 Regression] " rguenth at gcc dot gnu.org
@ 2021-04-23 10:21 ` dominiq at lps dot ens.fr
  2021-04-23 21:01 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-04-23 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org
      Known to fail|                            |11.0, 12.0
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-04-23
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Workaround: use -fno-frontend-optimize.

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

* [Bug fortran/100227] [8/9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
                   ` (2 preceding siblings ...)
  2021-04-23 10:21 ` dominiq at lps dot ens.fr
@ 2021-04-23 21:01 ` anlauf at gcc dot gnu.org
  2021-05-14  9:54 ` [Bug fortran/100227] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-04-23 21:01 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #3 from anlauf at gcc dot gnu.org ---
Reduced testcase:

program p
  implicit none
  integer, parameter :: nbmode = 3
  integer :: k
  real    :: mass(nbmode*2)
  do k = 1, nbmode*2
     mass(k) = k
  end do
  print *, (mass(k+k), k=1,nbmode)
end program

Also valgrind shows that bad things happen with -ffrontend-optimize ...

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

* [Bug fortran/100227] [9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
                   ` (3 preceding siblings ...)
  2021-04-23 21:01 ` anlauf at gcc dot gnu.org
@ 2021-05-14  9:54 ` jakub at gcc dot gnu.org
  2021-06-01  8:20 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug fortran/100227] [9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
                   ` (4 preceding siblings ...)
  2021-05-14  9:54 ` [Bug fortran/100227] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:20 ` rguenth at gcc dot gnu.org
  2021-07-04 15:09 ` tkoenig at gcc dot gnu.org
  2021-07-12 13:51 ` tkoenig at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug fortran/100227] [9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
                   ` (5 preceding siblings ...)
  2021-06-01  8:20 ` rguenth at gcc dot gnu.org
@ 2021-07-04 15:09 ` tkoenig at gcc dot gnu.org
  2021-07-12 13:51 ` tkoenig at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2021-07-04 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org

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

* [Bug fortran/100227] [9/10/11/12 Regression] write with implicit loop
  2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
                   ` (6 preceding siblings ...)
  2021-07-04 15:09 ` tkoenig at gcc dot gnu.org
@ 2021-07-12 13:51 ` tkoenig at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2021-07-12 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed by

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

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

https://gcc.gnu.org/g:750d7364d9719e70b444d0c25d53550c65f180d1

https://gcc.gnu.org/g:5f8227f7c91fc59e4ad2d35114bed1272f7b0b2d

respectively for 12,11,10 and 9.

Why the commits did not hit bugzilla I do not know.

Thanks for the bug report!

Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Tue Jul 6 07:04:09 2021 +0200

    Do not replace variable op variable in I/O implied DO loop replacement.

    This PR came about because index expressions of the form k+k in
    implied DO loops in I/O statements were considered for replacement
    by array slices.

    Fixed by only doing the transformation if the expression is of the
    type expr OP contastant.

    gcc/fortran/ChangeLog:

            PR fortran/100227
            * frontend-passes.c (traverse_io_block): Adjust test for
            when a variable is eligible for the transformation to
            array slice.

    gcc/testsuite/ChangeLog:

            PR fortran/100227
            * gfortran.dg/implied_do_io_7.f90: New test.

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

end of thread, other threads:[~2021-07-12 13:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23  8:01 [Bug fortran/100227] New: write with implicit loop priv123 at hotmail dot fr
2021-04-23  8:37 ` [Bug fortran/100227] " priv123 at hotmail dot fr
2021-04-23  9:13 ` [Bug fortran/100227] [8/9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-04-23 10:21 ` dominiq at lps dot ens.fr
2021-04-23 21:01 ` anlauf at gcc dot gnu.org
2021-05-14  9:54 ` [Bug fortran/100227] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:20 ` rguenth at gcc dot gnu.org
2021-07-04 15:09 ` tkoenig at gcc dot gnu.org
2021-07-12 13:51 ` tkoenig 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).