[Bug fortran/125606] [15/16/17 Regression] gimplification failed: with -O1
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jun 6 20:55:11 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125606
--- Comment #19 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7
commit r17-1396-g2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7
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.
More information about the Gcc-bugs
mailing list