[Bug fortran/125606] [15/16 Regression] gimplification failed: with -O1
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 8 18:16:16 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125606
--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:3d3cd29e0aa28ae40cd5d61253ead22904ba3c4b
commit r16-9071-g3d3cd29e0aa28ae40cd5d61253ead22904ba3c4b
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sat Jun 6 21:59:49 2026 +0200
Fortran: fix ICE on LOC intrinsic with polymorphic argument [PR125606]
The fix for PR122977 improved the gfc_is_simply_contiguous check for
associate variables, but had a side effect when using the LOC() intrinsic
on SELECT TYPE temporaries where gfc_is_simply_contiguous could return
false. Fall back to simply taking the address of the variable's address.
PR fortran/125606
gcc/fortran/ChangeLog:
* trans-intrinsic.cc (gfc_conv_intrinsic_loc): When the argument
of LOC() is not scalar or known to be simply contiguous, simply
take the address of the argument array's first element.
gcc/testsuite/ChangeLog:
* gfortran.dg/loc_3.f90: New test.
(cherry picked from commit 2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7)
More information about the Gcc-bugs
mailing list