gnu/gcc/2dcdb2463f89930b8cdd2b15f962bd3df5dd83f7 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.
2 files changed