Ping! On Tue, 20 Apr 2021 at 12:51, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote:
> Hi All, > > This is another PDT warm-up patch before tackling the real beast: PR82649. > > As the contributor wrote in the PR, "The F08 standard clearly > distinguishes between type parameter definition statements and component > definition statements. See R425, R431, R435, and in particular see Note 6.7 > which says 'It [array%a, for example] is scalar even if designator is an > array.' " gfortran was not making this distinction. The patch realises the > fix by lifting the code used for inquiry part references into a new > function and calling for PDT parameters and inquiry references. The > arrayspec lbound is used for 'start' now, rather than unity. In principle > this should remove the need to suppress bound checking. However, since this > would be confusing for the user to say the least of it, the suppression has > been retained. > > Bootstraps and regtests on FC33/x86_64. OK for 12- and 11-branches? > > Cheers > > Paul > > Fortran: Make PDT LEN and KIND expressions always scalar [PR84119]. > > 2021-04-20 Paul Thomas <pa...@gcc.gnu.org> > > gcc/fortran > PR fortran/84119 > * resolve.c (reset_array_ref_to_scalar): New function. > (gfc_resolve_ref): Call it for PDT kind and len expressions. > Code for inquiry refs. moved to new function and replaced by a > call to it. > > gcc/testsuite/ > PR fortran/84119 > * gfortran.dg/pdt_32.f03: New test. > * gfortran.dg/pdt_20.f03: Correct the third test to be against > a scalar instead of an array. > > > -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein