]> gcc.gnu.org Git - gcc.git/commit
Fortran: handle bad array ctors with typespec [PR93483, PR107216, PR107219]
authorHarald Anlauf <anlauf@gmx.de>
Sat, 15 Oct 2022 19:56:56 +0000 (21:56 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Mon, 17 Oct 2022 17:18:27 +0000 (19:18 +0200)
commitd45af5c2eb1ba1e48449d8f3c5b4e3994a956f92
treec26bf775b5a7f230f25333e19e859397bb7bb0a5
parent34cecde675be67543b386b593132ce8b1bb0a3ab
Fortran: handle bad array ctors with typespec [PR93483, PR107216, PR107219]

gcc/fortran/ChangeLog:

PR fortran/93483
PR fortran/107216
PR fortran/107219
* arith.cc (reduce_unary): Handled expressions are EXP_CONSTANT and
EXPR_ARRAY.  Do not attempt to reduce otherwise.
(reduce_binary_ac): Likewise.
(reduce_binary_ca): Likewise.
(reduce_binary_aa): Moved check for EXP_CONSTANT and EXPR_ARRAY
from here ...
(reduce_binary): ... to here.
(eval_intrinsic): Catch failed reductions.
* gfortran.h (GFC_INTRINSIC_OPS): New enum ARITH_NOT_REDUCED to keep
track of expressions that were not reduced by the arithmetic evaluation
code.

gcc/testsuite/ChangeLog:

PR fortran/93483
PR fortran/107216
PR fortran/107219
* gfortran.dg/array_constructor_56.f90: New test.
* gfortran.dg/array_constructor_57.f90: New test.

Co-authored-by: Mikael Morin <mikael@gcc.gnu.org>
gcc/fortran/arith.cc
gcc/fortran/gfortran.h
gcc/testsuite/gfortran.dg/array_constructor_56.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/array_constructor_57.f90 [new file with mode: 0644]
This page took 0.071578 seconds and 6 git commands to generate.