https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119054
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jerry DeLisle <jvdeli...@gcc.gnu.org>: https://gcc.gnu.org/g:e4f886c463fffd0bd2b1c98fa668c20aab5b37d2 commit r14-11395-ge4f886c463fffd0bd2b1c98fa668c20aab5b37d2 Author: Jerry DeLisle <jvdeli...@gcc.gnu.org> Date: Fri Mar 7 18:33:29 2025 -0800 Fortran: Fix ICE in resolve.cc with -pedantic Fixes an ICE in gfc_resolve_code when passing an optional array to an elemental procedure with `-pedantic` enabled. PR95446 added the original check, this patch fixes the case where the other actual argument is an array literal (or something else other than a variable). PR fortran/119054 gcc/fortran/ChangeLog: * resolve.cc (resolve_elemental_actual): When checking other actual arguments to elemental procedures, don't check attributes of literals and function calls. gcc/testsuite/ChangeLog: * gfortran.dg/pr95446.f90: Expand test case to literals and function calls. Signed-off-by: Peter Hill <peter.h...@york.ac.uk> (cherry picked from commit 3014f8787196d7c0d15d24195c8f07167968ff55)