https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113956
--- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to anlauf from comment #4) > (In reply to Paul Thomas from comment #3) > > I can see why the assert is there but it is manifestly wrong for both the > > assumed length target and a constant length. > > That's why I wanted to pass this on to you. I am not sure what the precise > logic should be. > > > I was thrown a bit by the > > distros nulling out the asserts so that it compiled just fine with the > > system gfortran. > > If the system gfortran is based on 13.2 *release* then the bug is not yet > there ;-) It entered 13-branch through backport r13-7986. > > > Your patch is perfect :- This compiles and runs correctly: Paul, if you want to commit the patch, consider it preapproved :-) Otherwise I would take it, but I fear possible subtleties in the logic involved that I do not see...