Dear All, I just backported the fix for this as revision 237043. This was fixed on 6-branch, when it was trunk, as r232850.
I apologise for not doing this much earlier but, as the fortran list knows, life outside gfortran has intervened big-time over the last few months. I did not add a testcase, since the likelihood of any further fortran patches to 5.3.1 causing a regression here is essentially zero. Cheers Paul