]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Escalate failure when Hollerith constant to real conversion fails
authorHaochen Gui <guihaoc@gcc.gnu.org>
Fri, 24 Mar 2023 02:45:52 +0000 (10:45 +0800)
committerHaochen Gui <guihaoc@gcc.gnu.org>
Fri, 24 Mar 2023 02:47:13 +0000 (10:47 +0800)
commit3b67db31236631432e7f6d74ed49af9ae2183a4d
tree8bce8ec5e48fcd55fa984121d1b690206356e297
parent08ef17c75777ef9e4e7ead132ccd7a6d03ae6020
Fortran: Escalate failure when Hollerith constant to real conversion fails

gcc/fortran/
PR target/103628
* target-memory.cc (gfc_interpret_float): Return FAIL when
native_interpret_expr gets a NULL tree.
* arith.cc (gfc_hollerith2real): Return NULL when
gfc_interpret_float fails.
* error.cc (gfc_buffered_p): Define.
* gfortran.h (gfc_buffered_p): Declare.
* intrinsic.cc: Add diagnostic.h to include list.
(do_simplify): Save errorcount and check it at finish.  Report a
"Cannot simplify expression" error on a bad result if error count
doesn't change and no other errors buffered.

gcc/testsuite/
PR target/103628
* gfortran.dg/assumed_size_refs_2.f90: Check "Cannot simplify
expression" error.
* gfortran.dg/unpack_field_1.f90: Likewise.
* gfortran.dg/pr103628.f90: New.

Co-Authored-By: Tobias Burnus <tobias@codesourcery.com>
gcc/fortran/arith.cc
gcc/fortran/error.cc
gcc/fortran/gfortran.h
gcc/fortran/intrinsic.cc
gcc/fortran/target-memory.cc
gcc/testsuite/gfortran.dg/assumed_size_refs_2.f90
gcc/testsuite/gfortran.dg/pr103628.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/unpack_field_1.f90