[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 anlauf at gcc dot gnu.org changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #8 from anlauf at gcc dot gnu.org --- Fixed on all open branches.
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 --- Comment #7 from CVS Commits --- The releases/gcc-9 branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:a9717558340352c832413343cef71f588eaf commit r9-10188-ga9717558340352c832413343cef71f588eaf Author: Harald Anlauf Date: Tue May 10 23:41:57 2022 +0200 Fortran: fix error recovery on invalid array section gcc/fortran/ChangeLog: PR fortran/105230 * expr.c (find_array_section): Correct logic to avoid NULL pointer dereference on invalid array section. gcc/testsuite/ChangeLog: PR fortran/105230 * gfortran.dg/pr105230.f90: New test. Co-authored-by: Steven G. Kargl (cherry picked from commit 0acdbe29f66017fc5cca40dcbd72a0dd41491d07)
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 --- Comment #6 from CVS Commits --- The releases/gcc-10 branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:bbcff39a4c1004ef55c6a6330408a9fe8c258d01 commit r10-10748-gbbcff39a4c1004ef55c6a6330408a9fe8c258d01 Author: Harald Anlauf Date: Tue May 10 23:41:57 2022 +0200 Fortran: fix error recovery on invalid array section gcc/fortran/ChangeLog: PR fortran/105230 * expr.c (find_array_section): Correct logic to avoid NULL pointer dereference on invalid array section. gcc/testsuite/ChangeLog: PR fortran/105230 * gfortran.dg/pr105230.f90: New test. Co-authored-by: Steven G. Kargl (cherry picked from commit 0acdbe29f66017fc5cca40dcbd72a0dd41491d07)
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 --- Comment #5 from CVS Commits --- The releases/gcc-11 branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:34c60e5e776d29ae6eb9e2e94af1c67666ec1caa commit r11-10007-g34c60e5e776d29ae6eb9e2e94af1c67666ec1caa Author: Harald Anlauf Date: Tue May 10 23:41:57 2022 +0200 Fortran: fix error recovery on invalid array section gcc/fortran/ChangeLog: PR fortran/105230 * expr.c (find_array_section): Correct logic to avoid NULL pointer dereference on invalid array section. gcc/testsuite/ChangeLog: PR fortran/105230 * gfortran.dg/pr105230.f90: New test. Co-authored-by: Steven G. Kargl (cherry picked from commit 0acdbe29f66017fc5cca40dcbd72a0dd41491d07)
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 --- Comment #4 from CVS Commits --- The releases/gcc-12 branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:0b9bdcf6857b48bb7a147a9778963c942ecb2dd9 commit r12-8375-g0b9bdcf6857b48bb7a147a9778963c942ecb2dd9 Author: Harald Anlauf Date: Tue May 10 23:41:57 2022 +0200 Fortran: fix error recovery on invalid array section gcc/fortran/ChangeLog: PR fortran/105230 * expr.cc (find_array_section): Correct logic to avoid NULL pointer dereference on invalid array section. gcc/testsuite/ChangeLog: PR fortran/105230 * gfortran.dg/pr105230.f90: New test. Co-authored-by: Steven G. Kargl (cherry picked from commit 0acdbe29f66017fc5cca40dcbd72a0dd41491d07)
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 --- Comment #3 from CVS Commits --- The master branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:0acdbe29f66017fc5cca40dcbd72a0dd41491d07 commit r13-330-g0acdbe29f66017fc5cca40dcbd72a0dd41491d07 Author: Harald Anlauf Date: Tue May 10 23:41:57 2022 +0200 Fortran: fix error recovery on invalid array section gcc/fortran/ChangeLog: PR fortran/105230 * expr.cc (find_array_section): Correct logic to avoid NULL pointer dereference on invalid array section. gcc/testsuite/ChangeLog: PR fortran/105230 * gfortran.dg/pr105230.f90: New test. Co-authored-by: Steven G. Kargl
[Bug fortran/105230] [9/10/11/12/13 Regression] ICE in find_array_section, at fortran/expr.cc:1634
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105230 anlauf at gcc dot gnu.org changed: What|Removed |Added CC||anlauf at gcc dot gnu.org --- Comment #2 from anlauf at gcc dot gnu.org --- (In reply to kargl from comment #1) > Started with 22015e77d3e4. No, it didn't start with that commit. That commit missed the present situation. The ICE is pre-existing. > upper is NULL and later in 1634 it is dereferenced. This patch fixes > the problem, but the above logic likely needs fixing. That's right. Shorter fix: diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc index 86d61fed302..be94c18c836 100644 --- a/gcc/fortran/expr.cc +++ b/gcc/fortran/expr.cc @@ -1595,8 +1595,8 @@ find_array_section (gfc_expr *expr, gfc_ref *ref) if ((begin && begin->expr_type != EXPR_CONSTANT) || (finish && finish->expr_type != EXPR_CONSTANT) || (step && step->expr_type != EXPR_CONSTANT) - || (!begin && !lower) - || (!finish && !upper)) + || !lower + || !upper) { t = false; goto cleanup;