From: Mikael Morin <[email protected]>

Hello,

this is the seventh part of the array descriptor series.  The previous part,
still awaiting review, isolated the initialization of scalar descriptors to
three dedicated functions.  These three functions do more or less the same
thing, but with subtle differences, either caused by bugs, useless code, or
different requirements or assumptions about their input.

This part fixes the bugs, removes useless differences and unifies the three
implementations.

Patches 1, 4 and 9 fix bugs in the descriptor initialization.  They are
affecting either the elem_len value (patches 1 and 9) or the type value
(patch 4).
Patch 3 fixes a possible ICE bug.
Patch 6 removes the initialization of the span.
Patches 2 and 7 remove useless work in the descriptor initialization
generation.
Patches 5 and 8 factor common code to a shared function.

Fortran-tested on aarch64-unknown-linux-gnu.  OK for mainline?

--

Previous parts in the array descriptor series:

part 6 (awaiting review): fortran: Move scalar descriptor init
https://inbox.sourceware.org/gcc-patches/[email protected]/
https://inbox.sourceware.org/fortran/[email protected]/
https://patchwork.sourceware.org/project/gcc/cover/[email protected]/

part 5 (pushed):  fortran: Move null- or default-initialization
part 4 (pushed):  fortran: Move dtype fields constants
part 3 (dropped): fortran: Ensure read-only getters
part 2 (pushed):  fortran: Add getters and setters
part 1 (pushed):  fortran: Move existing functions to a separate file

Mikael Morin (9):
  fortran: array descriptor: Guess size from declared type [PR122521]
  fortran: array descriptor: Simplify scalar dtype initialization
    [PR122521]
  fortran: array descriptor: Add a check for class container type
    [PR122521]
  fortran: array descriptor: Mark polymorphic descriptors as such
    [PR122521]
  fortran: array descriptor: Factor scalar descriptor init 1/2
    [PR122521]
  fortran: array descriptor: Don't set the span in the scalar case
    [PR122521]
  fortran: array descriptor: Remove redundant array type unwrapping
    [PR122521]
  fortran: array descriptor: Factor scalar descriptor init 2/2
    [PR122521]
  fortran: array descriptor: Set polymorphic elem_len value [PR122521]

 gcc/fortran/trans-descriptor.cc               | 149 +++++++++++++-----
 gcc/fortran/trans-descriptor.h                |   6 +-
 gcc/fortran/trans-expr.cc                     |   4 +-
 gcc/fortran/trans-types.cc                    |  46 +++++-
 gcc/testsuite/gfortran.dg/assumed_rank_26.f90 |  26 +++
 .../gfortran.dg/coarray_collectives_18.f90    |   2 +-
 gcc/testsuite/gfortran.dg/sizeof_7.f90        |  30 ++++
 gcc/testsuite/gfortran.dg/sizeof_8.f90        |  33 ++++
 libgfortran/intrinsics/associated.c           |   5 +-
 9 files changed, 252 insertions(+), 49 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/assumed_rank_26.f90
 create mode 100644 gcc/testsuite/gfortran.dg/sizeof_7.f90
 create mode 100644 gcc/testsuite/gfortran.dg/sizeof_8.f90

-- 
2.53.0

Reply via email to