]> gcc.gnu.org Git - gcc.git/commit
Do not replace variable op variable in I/O implied DO loop replacement.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 6 Jul 2021 05:04:09 +0000 (07:04 +0200)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Thu, 8 Jul 2021 21:09:03 +0000 (23:09 +0200)
commitba58662d013aa14d408a0e7172765e3da707a9eb
tree3dcfc56f8c988d58c3408296947bb0c1aaa4f8e7
parent9f4e879cbcd8ff4bffcfb119c821bd4f1b7392fa
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.

(cherry picked from commit d7e3855d5dd8c001bb65dc7da1cda0249bfc2986)
gcc/fortran/frontend-passes.c
gcc/testsuite/gfortran.dg/implied_do_io_7.f90 [new file with mode: 0644]
This page took 0.064445 seconds and 6 git commands to generate.