https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122977
--- Comment #6 from anlauf at gcc dot gnu.org --- (In reply to Steve Kargl from comment #5) > On Wed, Dec 03, 2025 at 08:44:39PM +0000, anlauf at gcc dot gnu.org wrote: > > > > --- Comment #4 from anlauf at gcc dot gnu.org --- > > (In reply to Steve Kargl from comment #3) > > > > > > I haven't looked at the issue with gfc_is_simply_contiguous() in > > > comment #2, but if it passes regression testing, and you have a > > > testcase (or two) feel free to commit. The comment in the patch > > > explains the rationale. > > > > The change in comment#2 regresses on gfortran.dg/associate_11.f90 > > because it will pack the associate variable before passing to a subroutine. > > I don't have a simple answer yet. > > I see. In looking at the symbol_attribute struct in gfortran.h, > does the packing lead to attr.temporary or attr.artificial being > set? These are the only ones that look like they may convey > some needed info; otherwise, we could add a new packed_arg attribute. Unfortunately I do not fully understand what you mean. Determining the properties of the associate-variable at compile time will need more work. Associating with a contiguous pointer will make it contiguous. As of yet, associating it with a contiguous array could be determined for some cases, but we have no means to pass that information. (We could mis-use the contiguous attribute and set it in resolve_assoc_var if the target is non-pointer but known (or guessed) to be contiguous. Or add a new attribute contiguous_assoc_target - or some longer name... :) I am open for opinions.
