]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: checking and simplification of RESHAPE intrinsic [PR103794]
authorHarald Anlauf <anlauf@gmx.de>
Sun, 21 May 2023 20:25:29 +0000 (22:25 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 24 May 2023 19:51:02 +0000 (21:51 +0200)
commit5fd5d8fb744fd9251d04e4b17d04f2340e6a283b
tree9ee11c528359762ed26cfdcba196f8641fb1811f
parentefd2b55d8562c6e80cb7ee8b9b1f9418f0c00cd9
Fortran: checking and simplification of RESHAPE intrinsic [PR103794]

gcc/fortran/ChangeLog:

PR fortran/103794
* check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
ORDER before checking.
* gfortran.h (gfc_is_constant_array_expr): Add prototype.
* iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
* simplify.cc (is_constant_array_expr): If array is determined to be
constant, expand small array constructors if needed.
(gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
(gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
when no padding specified.

gcc/testsuite/ChangeLog:

PR fortran/103794
* gfortran.dg/reshape_10.f90: New test.
* gfortran.dg/reshape_11.f90: New test.
gcc/fortran/check.cc
gcc/fortran/gfortran.h
gcc/fortran/iresolve.cc
gcc/fortran/simplify.cc
gcc/testsuite/gfortran.dg/reshape_10.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/reshape_11.f90 [new file with mode: 0644]