[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Remplacement macro GFC_DIMENSION_SET -> GFC_DESCRIPTOR_DIMENSION_SET

Mikael Morin mikael@gcc.gnu.org
Sun Sep 14 16:37:22 GMT 2025


https://gcc.gnu.org/g:d23f1b62a725b310dbd5fcd858adac1648c34773

commit d23f1b62a725b310dbd5fcd858adac1648c34773
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Sun Sep 7 17:37:35 2025 +0200

    Remplacement macro GFC_DIMENSION_SET -> GFC_DESCRIPTOR_DIMENSION_SET
    
    Régénération fichiers générés

Diff:
---
 libgfortran/generated/all_l1.c           |  3 +-
 libgfortran/generated/all_l16.c          |  3 +-
 libgfortran/generated/all_l2.c           |  3 +-
 libgfortran/generated/all_l4.c           |  3 +-
 libgfortran/generated/all_l8.c           |  3 +-
 libgfortran/generated/any_l1.c           |  3 +-
 libgfortran/generated/any_l16.c          |  3 +-
 libgfortran/generated/any_l2.c           |  3 +-
 libgfortran/generated/any_l4.c           |  3 +-
 libgfortran/generated/any_l8.c           |  3 +-
 libgfortran/generated/bessel_r10.c       |  4 +-
 libgfortran/generated/bessel_r16.c       |  4 +-
 libgfortran/generated/bessel_r17.c       |  4 +-
 libgfortran/generated/bessel_r4.c        |  4 +-
 libgfortran/generated/bessel_r8.c        |  4 +-
 libgfortran/generated/count_16_l.c       |  3 +-
 libgfortran/generated/count_1_l.c        |  3 +-
 libgfortran/generated/count_2_l.c        |  3 +-
 libgfortran/generated/count_4_l.c        |  3 +-
 libgfortran/generated/count_8_l.c        |  3 +-
 libgfortran/generated/cshift1_16.c       |  2 +-
 libgfortran/generated/cshift1_4.c        |  2 +-
 libgfortran/generated/cshift1_8.c        |  2 +-
 libgfortran/generated/eoshift1_16.c      |  3 +-
 libgfortran/generated/eoshift1_4.c       |  3 +-
 libgfortran/generated/eoshift1_8.c       |  3 +-
 libgfortran/generated/eoshift3_16.c      |  3 +-
 libgfortran/generated/eoshift3_4.c       |  3 +-
 libgfortran/generated/eoshift3_8.c       |  3 +-
 libgfortran/generated/findloc0_c10.c     |  6 +--
 libgfortran/generated/findloc0_c16.c     |  6 +--
 libgfortran/generated/findloc0_c17.c     |  6 +--
 libgfortran/generated/findloc0_c4.c      |  6 +--
 libgfortran/generated/findloc0_c8.c      |  6 +--
 libgfortran/generated/findloc0_i1.c      |  6 +--
 libgfortran/generated/findloc0_i16.c     |  6 +--
 libgfortran/generated/findloc0_i2.c      |  6 +--
 libgfortran/generated/findloc0_i4.c      |  6 +--
 libgfortran/generated/findloc0_i8.c      |  6 +--
 libgfortran/generated/findloc0_r10.c     |  6 +--
 libgfortran/generated/findloc0_r16.c     |  6 +--
 libgfortran/generated/findloc0_r17.c     |  6 +--
 libgfortran/generated/findloc0_r4.c      |  6 +--
 libgfortran/generated/findloc0_r8.c      |  6 +--
 libgfortran/generated/findloc0_s1.c      |  6 +--
 libgfortran/generated/findloc0_s4.c      |  6 +--
 libgfortran/generated/findloc1_c10.c     |  8 ++-
 libgfortran/generated/findloc1_c16.c     |  8 ++-
 libgfortran/generated/findloc1_c17.c     |  8 ++-
 libgfortran/generated/findloc1_c4.c      |  8 ++-
 libgfortran/generated/findloc1_c8.c      |  8 ++-
 libgfortran/generated/findloc1_i1.c      |  8 ++-
 libgfortran/generated/findloc1_i16.c     |  8 ++-
 libgfortran/generated/findloc1_i2.c      |  8 ++-
 libgfortran/generated/findloc1_i4.c      |  8 ++-
 libgfortran/generated/findloc1_i8.c      |  8 ++-
 libgfortran/generated/findloc1_r10.c     |  8 ++-
 libgfortran/generated/findloc1_r16.c     |  8 ++-
 libgfortran/generated/findloc1_r17.c     |  8 ++-
 libgfortran/generated/findloc1_r4.c      |  8 ++-
 libgfortran/generated/findloc1_r8.c      |  8 ++-
 libgfortran/generated/findloc1_s1.c      |  8 ++-
 libgfortran/generated/findloc1_s4.c      |  8 ++-
 libgfortran/generated/iall_i1.c          |  9 ++--
 libgfortran/generated/iall_i16.c         |  9 ++--
 libgfortran/generated/iall_i2.c          |  9 ++--
 libgfortran/generated/iall_i4.c          |  9 ++--
 libgfortran/generated/iall_i8.c          |  9 ++--
 libgfortran/generated/iany_i1.c          |  9 ++--
 libgfortran/generated/iany_i16.c         |  9 ++--
 libgfortran/generated/iany_i2.c          |  9 ++--
 libgfortran/generated/iany_i4.c          |  9 ++--
 libgfortran/generated/iany_i8.c          |  9 ++--
 libgfortran/generated/iparity_i1.c       |  9 ++--
 libgfortran/generated/iparity_i16.c      |  9 ++--
 libgfortran/generated/iparity_i2.c       |  9 ++--
 libgfortran/generated/iparity_i4.c       |  9 ++--
 libgfortran/generated/iparity_i8.c       |  9 ++--
 libgfortran/generated/matmul_c10.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_c16.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_c17.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_c4.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_c8.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_i1.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_i16.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_i2.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_i4.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_i8.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_l16.c       | 18 +++----
 libgfortran/generated/matmul_l4.c        | 18 +++----
 libgfortran/generated/matmul_l8.c        | 18 +++----
 libgfortran/generated/matmul_r10.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_r16.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_r17.c       | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_r4.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmul_r8.c        | 90 ++++++++++++++++----------------
 libgfortran/generated/matmulavx128_c10.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_c16.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_c17.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_c4.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_c8.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_i1.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_i16.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_i2.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_i4.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_i8.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_r10.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_r16.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_r17.c | 36 ++++++-------
 libgfortran/generated/matmulavx128_r4.c  | 36 ++++++-------
 libgfortran/generated/matmulavx128_r8.c  | 36 ++++++-------
 libgfortran/generated/maxloc0_16_i1.c    |  6 +--
 libgfortran/generated/maxloc0_16_i16.c   |  6 +--
 libgfortran/generated/maxloc0_16_i2.c    |  6 +--
 libgfortran/generated/maxloc0_16_i4.c    |  6 +--
 libgfortran/generated/maxloc0_16_i8.c    |  6 +--
 libgfortran/generated/maxloc0_16_m1.c    |  6 +--
 libgfortran/generated/maxloc0_16_m16.c   |  6 +--
 libgfortran/generated/maxloc0_16_m2.c    |  6 +--
 libgfortran/generated/maxloc0_16_m4.c    |  6 +--
 libgfortran/generated/maxloc0_16_m8.c    |  6 +--
 libgfortran/generated/maxloc0_16_r10.c   |  6 +--
 libgfortran/generated/maxloc0_16_r16.c   |  6 +--
 libgfortran/generated/maxloc0_16_r17.c   |  6 +--
 libgfortran/generated/maxloc0_16_r4.c    |  6 +--
 libgfortran/generated/maxloc0_16_r8.c    |  6 +--
 libgfortran/generated/maxloc0_16_s1.c    |  6 +--
 libgfortran/generated/maxloc0_16_s4.c    |  6 +--
 libgfortran/generated/maxloc0_4_i1.c     |  6 +--
 libgfortran/generated/maxloc0_4_i16.c    |  6 +--
 libgfortran/generated/maxloc0_4_i2.c     |  6 +--
 libgfortran/generated/maxloc0_4_i4.c     |  6 +--
 libgfortran/generated/maxloc0_4_i8.c     |  6 +--
 libgfortran/generated/maxloc0_4_m1.c     |  6 +--
 libgfortran/generated/maxloc0_4_m16.c    |  6 +--
 libgfortran/generated/maxloc0_4_m2.c     |  6 +--
 libgfortran/generated/maxloc0_4_m4.c     |  6 +--
 libgfortran/generated/maxloc0_4_m8.c     |  6 +--
 libgfortran/generated/maxloc0_4_r10.c    |  6 +--
 libgfortran/generated/maxloc0_4_r16.c    |  6 +--
 libgfortran/generated/maxloc0_4_r17.c    |  6 +--
 libgfortran/generated/maxloc0_4_r4.c     |  6 +--
 libgfortran/generated/maxloc0_4_r8.c     |  6 +--
 libgfortran/generated/maxloc0_4_s1.c     |  6 +--
 libgfortran/generated/maxloc0_4_s4.c     |  6 +--
 libgfortran/generated/maxloc0_8_i1.c     |  6 +--
 libgfortran/generated/maxloc0_8_i16.c    |  6 +--
 libgfortran/generated/maxloc0_8_i2.c     |  6 +--
 libgfortran/generated/maxloc0_8_i4.c     |  6 +--
 libgfortran/generated/maxloc0_8_i8.c     |  6 +--
 libgfortran/generated/maxloc0_8_m1.c     |  6 +--
 libgfortran/generated/maxloc0_8_m16.c    |  6 +--
 libgfortran/generated/maxloc0_8_m2.c     |  6 +--
 libgfortran/generated/maxloc0_8_m4.c     |  6 +--
 libgfortran/generated/maxloc0_8_m8.c     |  6 +--
 libgfortran/generated/maxloc0_8_r10.c    |  6 +--
 libgfortran/generated/maxloc0_8_r16.c    |  6 +--
 libgfortran/generated/maxloc0_8_r17.c    |  6 +--
 libgfortran/generated/maxloc0_8_r4.c     |  6 +--
 libgfortran/generated/maxloc0_8_r8.c     |  6 +--
 libgfortran/generated/maxloc0_8_s1.c     |  6 +--
 libgfortran/generated/maxloc0_8_s4.c     |  6 +--
 libgfortran/generated/maxloc1_16_i1.c    |  9 ++--
 libgfortran/generated/maxloc1_16_i16.c   |  9 ++--
 libgfortran/generated/maxloc1_16_i2.c    |  9 ++--
 libgfortran/generated/maxloc1_16_i4.c    |  9 ++--
 libgfortran/generated/maxloc1_16_i8.c    |  9 ++--
 libgfortran/generated/maxloc1_16_m1.c    |  9 ++--
 libgfortran/generated/maxloc1_16_m16.c   |  9 ++--
 libgfortran/generated/maxloc1_16_m2.c    |  9 ++--
 libgfortran/generated/maxloc1_16_m4.c    |  9 ++--
 libgfortran/generated/maxloc1_16_m8.c    |  9 ++--
 libgfortran/generated/maxloc1_16_r10.c   |  9 ++--
 libgfortran/generated/maxloc1_16_r16.c   |  9 ++--
 libgfortran/generated/maxloc1_16_r17.c   |  9 ++--
 libgfortran/generated/maxloc1_16_r4.c    |  9 ++--
 libgfortran/generated/maxloc1_16_r8.c    |  9 ++--
 libgfortran/generated/maxloc1_16_s1.c    |  9 ++--
 libgfortran/generated/maxloc1_16_s4.c    |  9 ++--
 libgfortran/generated/maxloc1_4_i1.c     |  9 ++--
 libgfortran/generated/maxloc1_4_i16.c    |  9 ++--
 libgfortran/generated/maxloc1_4_i2.c     |  9 ++--
 libgfortran/generated/maxloc1_4_i4.c     |  9 ++--
 libgfortran/generated/maxloc1_4_i8.c     |  9 ++--
 libgfortran/generated/maxloc1_4_m1.c     |  9 ++--
 libgfortran/generated/maxloc1_4_m16.c    |  9 ++--
 libgfortran/generated/maxloc1_4_m2.c     |  9 ++--
 libgfortran/generated/maxloc1_4_m4.c     |  9 ++--
 libgfortran/generated/maxloc1_4_m8.c     |  9 ++--
 libgfortran/generated/maxloc1_4_r10.c    |  9 ++--
 libgfortran/generated/maxloc1_4_r16.c    |  9 ++--
 libgfortran/generated/maxloc1_4_r17.c    |  9 ++--
 libgfortran/generated/maxloc1_4_r4.c     |  9 ++--
 libgfortran/generated/maxloc1_4_r8.c     |  9 ++--
 libgfortran/generated/maxloc1_4_s1.c     |  9 ++--
 libgfortran/generated/maxloc1_4_s4.c     |  9 ++--
 libgfortran/generated/maxloc1_8_i1.c     |  9 ++--
 libgfortran/generated/maxloc1_8_i16.c    |  9 ++--
 libgfortran/generated/maxloc1_8_i2.c     |  9 ++--
 libgfortran/generated/maxloc1_8_i4.c     |  9 ++--
 libgfortran/generated/maxloc1_8_i8.c     |  9 ++--
 libgfortran/generated/maxloc1_8_m1.c     |  9 ++--
 libgfortran/generated/maxloc1_8_m16.c    |  9 ++--
 libgfortran/generated/maxloc1_8_m2.c     |  9 ++--
 libgfortran/generated/maxloc1_8_m4.c     |  9 ++--
 libgfortran/generated/maxloc1_8_m8.c     |  9 ++--
 libgfortran/generated/maxloc1_8_r10.c    |  9 ++--
 libgfortran/generated/maxloc1_8_r16.c    |  9 ++--
 libgfortran/generated/maxloc1_8_r17.c    |  9 ++--
 libgfortran/generated/maxloc1_8_r4.c     |  9 ++--
 libgfortran/generated/maxloc1_8_r8.c     |  9 ++--
 libgfortran/generated/maxloc1_8_s1.c     |  9 ++--
 libgfortran/generated/maxloc1_8_s4.c     |  9 ++--
 libgfortran/generated/maxval1_s1.c       |  9 ++--
 libgfortran/generated/maxval1_s4.c       |  9 ++--
 libgfortran/generated/maxval_i1.c        |  9 ++--
 libgfortran/generated/maxval_i16.c       |  9 ++--
 libgfortran/generated/maxval_i2.c        |  9 ++--
 libgfortran/generated/maxval_i4.c        |  9 ++--
 libgfortran/generated/maxval_i8.c        |  9 ++--
 libgfortran/generated/maxval_m1.c        |  9 ++--
 libgfortran/generated/maxval_m16.c       |  9 ++--
 libgfortran/generated/maxval_m2.c        |  9 ++--
 libgfortran/generated/maxval_m4.c        |  9 ++--
 libgfortran/generated/maxval_m8.c        |  9 ++--
 libgfortran/generated/maxval_r10.c       |  9 ++--
 libgfortran/generated/maxval_r16.c       |  9 ++--
 libgfortran/generated/maxval_r17.c       |  9 ++--
 libgfortran/generated/maxval_r4.c        |  9 ++--
 libgfortran/generated/maxval_r8.c        |  9 ++--
 libgfortran/generated/minloc0_16_i1.c    |  6 +--
 libgfortran/generated/minloc0_16_i16.c   |  6 +--
 libgfortran/generated/minloc0_16_i2.c    |  6 +--
 libgfortran/generated/minloc0_16_i4.c    |  6 +--
 libgfortran/generated/minloc0_16_i8.c    |  6 +--
 libgfortran/generated/minloc0_16_m1.c    |  6 +--
 libgfortran/generated/minloc0_16_m16.c   |  6 +--
 libgfortran/generated/minloc0_16_m2.c    |  6 +--
 libgfortran/generated/minloc0_16_m4.c    |  6 +--
 libgfortran/generated/minloc0_16_m8.c    |  6 +--
 libgfortran/generated/minloc0_16_r10.c   |  6 +--
 libgfortran/generated/minloc0_16_r16.c   |  6 +--
 libgfortran/generated/minloc0_16_r17.c   |  6 +--
 libgfortran/generated/minloc0_16_r4.c    |  6 +--
 libgfortran/generated/minloc0_16_r8.c    |  6 +--
 libgfortran/generated/minloc0_16_s1.c    |  6 +--
 libgfortran/generated/minloc0_16_s4.c    |  6 +--
 libgfortran/generated/minloc0_4_i1.c     |  6 +--
 libgfortran/generated/minloc0_4_i16.c    |  6 +--
 libgfortran/generated/minloc0_4_i2.c     |  6 +--
 libgfortran/generated/minloc0_4_i4.c     |  6 +--
 libgfortran/generated/minloc0_4_i8.c     |  6 +--
 libgfortran/generated/minloc0_4_m1.c     |  6 +--
 libgfortran/generated/minloc0_4_m16.c    |  6 +--
 libgfortran/generated/minloc0_4_m2.c     |  6 +--
 libgfortran/generated/minloc0_4_m4.c     |  6 +--
 libgfortran/generated/minloc0_4_m8.c     |  6 +--
 libgfortran/generated/minloc0_4_r10.c    |  6 +--
 libgfortran/generated/minloc0_4_r16.c    |  6 +--
 libgfortran/generated/minloc0_4_r17.c    |  6 +--
 libgfortran/generated/minloc0_4_r4.c     |  6 +--
 libgfortran/generated/minloc0_4_r8.c     |  6 +--
 libgfortran/generated/minloc0_4_s1.c     |  6 +--
 libgfortran/generated/minloc0_4_s4.c     |  6 +--
 libgfortran/generated/minloc0_8_i1.c     |  6 +--
 libgfortran/generated/minloc0_8_i16.c    |  6 +--
 libgfortran/generated/minloc0_8_i2.c     |  6 +--
 libgfortran/generated/minloc0_8_i4.c     |  6 +--
 libgfortran/generated/minloc0_8_i8.c     |  6 +--
 libgfortran/generated/minloc0_8_m1.c     |  6 +--
 libgfortran/generated/minloc0_8_m16.c    |  6 +--
 libgfortran/generated/minloc0_8_m2.c     |  6 +--
 libgfortran/generated/minloc0_8_m4.c     |  6 +--
 libgfortran/generated/minloc0_8_m8.c     |  6 +--
 libgfortran/generated/minloc0_8_r10.c    |  6 +--
 libgfortran/generated/minloc0_8_r16.c    |  6 +--
 libgfortran/generated/minloc0_8_r17.c    |  6 +--
 libgfortran/generated/minloc0_8_r4.c     |  6 +--
 libgfortran/generated/minloc0_8_r8.c     |  6 +--
 libgfortran/generated/minloc0_8_s1.c     |  6 +--
 libgfortran/generated/minloc0_8_s4.c     |  6 +--
 libgfortran/generated/minloc1_16_i1.c    |  9 ++--
 libgfortran/generated/minloc1_16_i16.c   |  9 ++--
 libgfortran/generated/minloc1_16_i2.c    |  9 ++--
 libgfortran/generated/minloc1_16_i4.c    |  9 ++--
 libgfortran/generated/minloc1_16_i8.c    |  9 ++--
 libgfortran/generated/minloc1_16_m1.c    |  9 ++--
 libgfortran/generated/minloc1_16_m16.c   |  9 ++--
 libgfortran/generated/minloc1_16_m2.c    |  9 ++--
 libgfortran/generated/minloc1_16_m4.c    |  9 ++--
 libgfortran/generated/minloc1_16_m8.c    |  9 ++--
 libgfortran/generated/minloc1_16_r10.c   |  9 ++--
 libgfortran/generated/minloc1_16_r16.c   |  9 ++--
 libgfortran/generated/minloc1_16_r17.c   |  9 ++--
 libgfortran/generated/minloc1_16_r4.c    |  9 ++--
 libgfortran/generated/minloc1_16_r8.c    |  9 ++--
 libgfortran/generated/minloc1_16_s1.c    |  9 ++--
 libgfortran/generated/minloc1_16_s4.c    |  9 ++--
 libgfortran/generated/minloc1_4_i1.c     |  9 ++--
 libgfortran/generated/minloc1_4_i16.c    |  9 ++--
 libgfortran/generated/minloc1_4_i2.c     |  9 ++--
 libgfortran/generated/minloc1_4_i4.c     |  9 ++--
 libgfortran/generated/minloc1_4_i8.c     |  9 ++--
 libgfortran/generated/minloc1_4_m1.c     |  9 ++--
 libgfortran/generated/minloc1_4_m16.c    |  9 ++--
 libgfortran/generated/minloc1_4_m2.c     |  9 ++--
 libgfortran/generated/minloc1_4_m4.c     |  9 ++--
 libgfortran/generated/minloc1_4_m8.c     |  9 ++--
 libgfortran/generated/minloc1_4_r10.c    |  9 ++--
 libgfortran/generated/minloc1_4_r16.c    |  9 ++--
 libgfortran/generated/minloc1_4_r17.c    |  9 ++--
 libgfortran/generated/minloc1_4_r4.c     |  9 ++--
 libgfortran/generated/minloc1_4_r8.c     |  9 ++--
 libgfortran/generated/minloc1_4_s1.c     |  9 ++--
 libgfortran/generated/minloc1_4_s4.c     |  9 ++--
 libgfortran/generated/minloc1_8_i1.c     |  9 ++--
 libgfortran/generated/minloc1_8_i16.c    |  9 ++--
 libgfortran/generated/minloc1_8_i2.c     |  9 ++--
 libgfortran/generated/minloc1_8_i4.c     |  9 ++--
 libgfortran/generated/minloc1_8_i8.c     |  9 ++--
 libgfortran/generated/minloc1_8_m1.c     |  9 ++--
 libgfortran/generated/minloc1_8_m16.c    |  9 ++--
 libgfortran/generated/minloc1_8_m2.c     |  9 ++--
 libgfortran/generated/minloc1_8_m4.c     |  9 ++--
 libgfortran/generated/minloc1_8_m8.c     |  9 ++--
 libgfortran/generated/minloc1_8_r10.c    |  9 ++--
 libgfortran/generated/minloc1_8_r16.c    |  9 ++--
 libgfortran/generated/minloc1_8_r17.c    |  9 ++--
 libgfortran/generated/minloc1_8_r4.c     |  9 ++--
 libgfortran/generated/minloc1_8_r8.c     |  9 ++--
 libgfortran/generated/minloc1_8_s1.c     |  9 ++--
 libgfortran/generated/minloc1_8_s4.c     |  9 ++--
 libgfortran/generated/minval1_s1.c       |  9 ++--
 libgfortran/generated/minval1_s4.c       |  9 ++--
 libgfortran/generated/minval_i1.c        |  9 ++--
 libgfortran/generated/minval_i16.c       |  9 ++--
 libgfortran/generated/minval_i2.c        |  9 ++--
 libgfortran/generated/minval_i4.c        |  9 ++--
 libgfortran/generated/minval_i8.c        |  9 ++--
 libgfortran/generated/minval_m1.c        |  9 ++--
 libgfortran/generated/minval_m16.c       |  9 ++--
 libgfortran/generated/minval_m2.c        |  9 ++--
 libgfortran/generated/minval_m4.c        |  9 ++--
 libgfortran/generated/minval_m8.c        |  9 ++--
 libgfortran/generated/minval_r10.c       |  9 ++--
 libgfortran/generated/minval_r16.c       |  9 ++--
 libgfortran/generated/minval_r17.c       |  9 ++--
 libgfortran/generated/minval_r4.c        |  9 ++--
 libgfortran/generated/minval_r8.c        |  9 ++--
 libgfortran/generated/norm2_r10.c        |  3 +-
 libgfortran/generated/norm2_r16.c        |  3 +-
 libgfortran/generated/norm2_r17.c        |  3 +-
 libgfortran/generated/norm2_r4.c         |  3 +-
 libgfortran/generated/norm2_r8.c         |  3 +-
 libgfortran/generated/pack_c10.c         |  2 +-
 libgfortran/generated/pack_c16.c         |  2 +-
 libgfortran/generated/pack_c17.c         |  2 +-
 libgfortran/generated/pack_c4.c          |  2 +-
 libgfortran/generated/pack_c8.c          |  2 +-
 libgfortran/generated/pack_i1.c          |  2 +-
 libgfortran/generated/pack_i16.c         |  2 +-
 libgfortran/generated/pack_i2.c          |  2 +-
 libgfortran/generated/pack_i4.c          |  2 +-
 libgfortran/generated/pack_i8.c          |  2 +-
 libgfortran/generated/pack_r10.c         |  2 +-
 libgfortran/generated/pack_r16.c         |  2 +-
 libgfortran/generated/pack_r17.c         |  2 +-
 libgfortran/generated/pack_r4.c          |  2 +-
 libgfortran/generated/pack_r8.c          |  2 +-
 libgfortran/generated/parity_l1.c        |  3 +-
 libgfortran/generated/parity_l16.c       |  3 +-
 libgfortran/generated/parity_l2.c        |  3 +-
 libgfortran/generated/parity_l4.c        |  3 +-
 libgfortran/generated/parity_l8.c        |  3 +-
 libgfortran/generated/product_c10.c      |  9 ++--
 libgfortran/generated/product_c16.c      |  9 ++--
 libgfortran/generated/product_c17.c      |  9 ++--
 libgfortran/generated/product_c4.c       |  9 ++--
 libgfortran/generated/product_c8.c       |  9 ++--
 libgfortran/generated/product_i1.c       |  9 ++--
 libgfortran/generated/product_i16.c      |  9 ++--
 libgfortran/generated/product_i2.c       |  9 ++--
 libgfortran/generated/product_i4.c       |  9 ++--
 libgfortran/generated/product_i8.c       |  9 ++--
 libgfortran/generated/product_r10.c      |  9 ++--
 libgfortran/generated/product_r16.c      |  9 ++--
 libgfortran/generated/product_r17.c      |  9 ++--
 libgfortran/generated/product_r4.c       |  9 ++--
 libgfortran/generated/product_r8.c       |  9 ++--
 libgfortran/generated/reshape_c10.c      |  2 +-
 libgfortran/generated/reshape_c16.c      |  2 +-
 libgfortran/generated/reshape_c17.c      |  2 +-
 libgfortran/generated/reshape_c4.c       |  2 +-
 libgfortran/generated/reshape_c8.c       |  2 +-
 libgfortran/generated/reshape_i16.c      |  2 +-
 libgfortran/generated/reshape_i4.c       |  2 +-
 libgfortran/generated/reshape_i8.c       |  2 +-
 libgfortran/generated/reshape_r10.c      |  2 +-
 libgfortran/generated/reshape_r16.c      |  2 +-
 libgfortran/generated/reshape_r17.c      |  2 +-
 libgfortran/generated/reshape_r4.c       |  2 +-
 libgfortran/generated/reshape_r8.c       |  2 +-
 libgfortran/generated/shape_i1.c         |  2 +-
 libgfortran/generated/shape_i16.c        |  2 +-
 libgfortran/generated/shape_i2.c         |  2 +-
 libgfortran/generated/shape_i4.c         |  2 +-
 libgfortran/generated/shape_i8.c         |  2 +-
 libgfortran/generated/spread_c10.c       |  4 +-
 libgfortran/generated/spread_c16.c       |  4 +-
 libgfortran/generated/spread_c17.c       |  4 +-
 libgfortran/generated/spread_c4.c        |  4 +-
 libgfortran/generated/spread_c8.c        |  4 +-
 libgfortran/generated/spread_i1.c        |  4 +-
 libgfortran/generated/spread_i16.c       |  4 +-
 libgfortran/generated/spread_i2.c        |  4 +-
 libgfortran/generated/spread_i4.c        |  4 +-
 libgfortran/generated/spread_i8.c        |  4 +-
 libgfortran/generated/spread_r10.c       |  4 +-
 libgfortran/generated/spread_r16.c       |  4 +-
 libgfortran/generated/spread_r17.c       |  4 +-
 libgfortran/generated/spread_r4.c        |  4 +-
 libgfortran/generated/spread_r8.c        |  4 +-
 libgfortran/generated/sum_c10.c          |  9 ++--
 libgfortran/generated/sum_c16.c          |  9 ++--
 libgfortran/generated/sum_c17.c          |  9 ++--
 libgfortran/generated/sum_c4.c           |  9 ++--
 libgfortran/generated/sum_c8.c           |  9 ++--
 libgfortran/generated/sum_i1.c           |  9 ++--
 libgfortran/generated/sum_i16.c          |  9 ++--
 libgfortran/generated/sum_i2.c           |  9 ++--
 libgfortran/generated/sum_i4.c           |  9 ++--
 libgfortran/generated/sum_i8.c           |  9 ++--
 libgfortran/generated/sum_r10.c          |  9 ++--
 libgfortran/generated/sum_r16.c          |  9 ++--
 libgfortran/generated/sum_r17.c          |  9 ++--
 libgfortran/generated/sum_r4.c           |  9 ++--
 libgfortran/generated/sum_r8.c           |  9 ++--
 libgfortran/generated/unpack_c10.c       |  8 +--
 libgfortran/generated/unpack_c16.c       |  8 +--
 libgfortran/generated/unpack_c17.c       |  8 +--
 libgfortran/generated/unpack_c4.c        |  8 +--
 libgfortran/generated/unpack_c8.c        |  8 +--
 libgfortran/generated/unpack_i1.c        |  8 +--
 libgfortran/generated/unpack_i16.c       |  8 +--
 libgfortran/generated/unpack_i2.c        |  8 +--
 libgfortran/generated/unpack_i4.c        |  8 +--
 libgfortran/generated/unpack_i8.c        |  8 +--
 libgfortran/generated/unpack_r10.c       |  8 +--
 libgfortran/generated/unpack_r16.c       |  8 +--
 libgfortran/generated/unpack_r17.c       |  8 +--
 libgfortran/generated/unpack_r4.c        |  8 +--
 libgfortran/generated/unpack_r8.c        |  8 +--
 libgfortran/intrinsics/cshift0.c         |  2 +-
 libgfortran/intrinsics/date_and_time.c   |  2 +-
 libgfortran/intrinsics/eoshift0.c        |  2 +-
 libgfortran/intrinsics/eoshift2.c        |  2 +-
 libgfortran/intrinsics/move_alloc.c      | 10 ++--
 libgfortran/intrinsics/pack_generic.c    |  4 +-
 libgfortran/intrinsics/reduce.c          |  2 +-
 libgfortran/intrinsics/reshape_generic.c |  2 +-
 libgfortran/intrinsics/spread_generic.c  |  4 +-
 libgfortran/intrinsics/unpack_generic.c  |  4 +-
 libgfortran/io/format.c                  |  4 +-
 libgfortran/io/list_read.c               |  4 +-
 libgfortran/io/transfer.c                |  2 +-
 libgfortran/io/write.c                   |  4 +-
 libgfortran/libgfortran.h                |  9 ++--
 libgfortran/m4/bessel.m4                 |  4 +-
 libgfortran/m4/cshift1.m4                |  2 +-
 libgfortran/m4/eoshift1.m4               |  3 +-
 libgfortran/m4/eoshift3.m4               |  3 +-
 libgfortran/m4/ifindloc0.m4              |  6 +--
 libgfortran/m4/ifindloc1.m4              |  8 ++-
 libgfortran/m4/iforeach-s.m4             |  6 +--
 libgfortran/m4/iforeach.m4               |  6 +--
 libgfortran/m4/ifunction-s.m4            |  9 ++--
 libgfortran/m4/ifunction-s2.m4           |  9 ++--
 libgfortran/m4/ifunction.m4              |  9 ++--
 libgfortran/m4/ifunction_logical.m4      |  3 +-
 libgfortran/m4/matmul_internal.m4        | 18 +++----
 libgfortran/m4/matmull.m4                | 18 +++----
 libgfortran/m4/pack.m4                   |  2 +-
 libgfortran/m4/reshape.m4                |  2 +-
 libgfortran/m4/shape.m4                  |  2 +-
 libgfortran/m4/spread.m4                 |  4 +-
 libgfortran/m4/unpack.m4                 |  8 +--
 486 files changed, 2172 insertions(+), 2795 deletions(-)

diff --git a/libgfortran/generated/all_l1.c b/libgfortran/generated/all_l1.c
index 848f86a604f8..218ebd9c56e6 100644
--- a/libgfortran/generated/all_l1.c
+++ b/libgfortran/generated/all_l1.c
@@ -92,8 +92,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/all_l16.c b/libgfortran/generated/all_l16.c
index cd3c019a0afc..e474903c8715 100644
--- a/libgfortran/generated/all_l16.c
+++ b/libgfortran/generated/all_l16.c
@@ -92,8 +92,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/all_l2.c b/libgfortran/generated/all_l2.c
index 98135759ce42..752f37dafa94 100644
--- a/libgfortran/generated/all_l2.c
+++ b/libgfortran/generated/all_l2.c
@@ -92,8 +92,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c
index 7ca764734291..7ee73dce38e8 100644
--- a/libgfortran/generated/all_l4.c
+++ b/libgfortran/generated/all_l4.c
@@ -92,8 +92,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c
index 3171c72ea2e3..cb76145c31b3 100644
--- a/libgfortran/generated/all_l8.c
+++ b/libgfortran/generated/all_l8.c
@@ -92,8 +92,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/any_l1.c b/libgfortran/generated/any_l1.c
index 6099621e13e4..ef3584dea1a1 100644
--- a/libgfortran/generated/any_l1.c
+++ b/libgfortran/generated/any_l1.c
@@ -92,8 +92,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/any_l16.c b/libgfortran/generated/any_l16.c
index 2c38cdbc0721..843769a7d5f9 100644
--- a/libgfortran/generated/any_l16.c
+++ b/libgfortran/generated/any_l16.c
@@ -92,8 +92,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/any_l2.c b/libgfortran/generated/any_l2.c
index 0d52c7c6fda1..0e2f85fb5f21 100644
--- a/libgfortran/generated/any_l2.c
+++ b/libgfortran/generated/any_l2.c
@@ -92,8 +92,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c
index b865789124b4..a21c7e52e6cb 100644
--- a/libgfortran/generated/any_l4.c
+++ b/libgfortran/generated/any_l4.c
@@ -92,8 +92,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c
index d437a1b9e59f..dc3d5a1f2591 100644
--- a/libgfortran/generated/any_l8.c
+++ b/libgfortran/generated/any_l8.c
@@ -92,8 +92,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c
index f95528090cb6..2b38e4c2fddb 100644
--- a/libgfortran/generated/bessel_r10.c
+++ b/libgfortran/generated/bessel_r10.c
@@ -52,7 +52,7 @@ bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
       ret->offset = 0;
     }
@@ -119,7 +119,7 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_10));
       ret->offset = 0;
     }
diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c
index e6c1402d0e58..bf809eba26f6 100644
--- a/libgfortran/generated/bessel_r16.c
+++ b/libgfortran/generated/bessel_r16.c
@@ -60,7 +60,7 @@ bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
       ret->offset = 0;
     }
@@ -127,7 +127,7 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_16));
       ret->offset = 0;
     }
diff --git a/libgfortran/generated/bessel_r17.c b/libgfortran/generated/bessel_r17.c
index b05bd3479110..a9e9e9788164 100644
--- a/libgfortran/generated/bessel_r17.c
+++ b/libgfortran/generated/bessel_r17.c
@@ -58,7 +58,7 @@ bessel_jn_r17 (gfc_array_r17 * const restrict ret, int n1, int n2, GFC_REAL_17 x
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_17));
       ret->offset = 0;
     }
@@ -125,7 +125,7 @@ bessel_yn_r17 (gfc_array_r17 * const restrict ret, int n1, int n2,
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_17));
       ret->offset = 0;
     }
diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c
index 62e53111f689..316609fbd512 100644
--- a/libgfortran/generated/bessel_r4.c
+++ b/libgfortran/generated/bessel_r4.c
@@ -52,7 +52,7 @@ bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x)
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
       ret->offset = 0;
     }
@@ -119,7 +119,7 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_4));
       ret->offset = 0;
     }
diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c
index 50388275f540..66878a21e8e6 100644
--- a/libgfortran/generated/bessel_r8.c
+++ b/libgfortran/generated/bessel_r8.c
@@ -52,7 +52,7 @@ bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x)
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
       ret->offset = 0;
     }
@@ -119,7 +119,7 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
   if (ret->base_addr == NULL)
     {
       size_t size = n2 < n1 ? 0 : n2-n1+1; 
-      GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(ret, 0, 0, size-1, 1);
       ret->base_addr = xmallocarray (size, sizeof (GFC_REAL_8));
       ret->offset = 0;
     }
diff --git a/libgfortran/generated/count_16_l.c b/libgfortran/generated/count_16_l.c
index b6406e690d2f..a17f36a853ea 100644
--- a/libgfortran/generated/count_16_l.c
+++ b/libgfortran/generated/count_16_l.c
@@ -92,8 +92,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/count_1_l.c b/libgfortran/generated/count_1_l.c
index 475d6d11c068..c6df299d4203 100644
--- a/libgfortran/generated/count_1_l.c
+++ b/libgfortran/generated/count_1_l.c
@@ -92,8 +92,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/count_2_l.c b/libgfortran/generated/count_2_l.c
index 1ef08132512c..14820b0be09d 100644
--- a/libgfortran/generated/count_2_l.c
+++ b/libgfortran/generated/count_2_l.c
@@ -92,8 +92,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/count_4_l.c b/libgfortran/generated/count_4_l.c
index 4b4f5b046dac..d3c8f99b278b 100644
--- a/libgfortran/generated/count_4_l.c
+++ b/libgfortran/generated/count_4_l.c
@@ -92,8 +92,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/count_8_l.c b/libgfortran/generated/count_8_l.c
index e58370c3d651..1af39fbe32cb 100644
--- a/libgfortran/generated/count_8_l.c
+++ b/libgfortran/generated/count_8_l.c
@@ -92,8 +92,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
           else
             str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
         }
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c
index 6b3653d235bf..2906edeb4162 100644
--- a/libgfortran/generated/cshift1_16.c
+++ b/libgfortran/generated/cshift1_16.c
@@ -92,7 +92,7 @@ cshift1 (gfc_array_char * const restrict ret,
 	    str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
 	      GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
     }
   else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c
index e1e039950702..8d1851f8655d 100644
--- a/libgfortran/generated/cshift1_4.c
+++ b/libgfortran/generated/cshift1_4.c
@@ -92,7 +92,7 @@ cshift1 (gfc_array_char * const restrict ret,
 	    str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
 	      GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
     }
   else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c
index d94f42d3989e..1afb921e8053 100644
--- a/libgfortran/generated/cshift1_8.c
+++ b/libgfortran/generated/cshift1_8.c
@@ -92,7 +92,7 @@ cshift1 (gfc_array_char * const restrict ret,
 	    str = GFC_DESCRIPTOR_EXTENT(ret,i-1) *
 	      GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
     }
   else if (unlikely (compile_options.bounds_check))
diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c
index b78cd6feb355..4dd86bf8733e 100644
--- a/libgfortran/generated/eoshift1_16.c
+++ b/libgfortran/generated/eoshift1_16.c
@@ -98,8 +98,7 @@ eoshift1 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c
index e013da8dc223..96e73cb7ecc3 100644
--- a/libgfortran/generated/eoshift1_4.c
+++ b/libgfortran/generated/eoshift1_4.c
@@ -98,8 +98,7 @@ eoshift1 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c
index 061ce0879cf4..5f62d46e6b32 100644
--- a/libgfortran/generated/eoshift1_8.c
+++ b/libgfortran/generated/eoshift1_8.c
@@ -98,8 +98,7 @@ eoshift1 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c
index 911dd1c863ca..cb533dfbd48d 100644
--- a/libgfortran/generated/eoshift3_16.c
+++ b/libgfortran/generated/eoshift3_16.c
@@ -100,8 +100,7 @@ eoshift3 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c
index e2a4deb40566..084d7d81e636 100644
--- a/libgfortran/generated/eoshift3_4.c
+++ b/libgfortran/generated/eoshift3_4.c
@@ -100,8 +100,7 @@ eoshift3 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c
index 5581a9192b15..ee1eec8766b8 100644
--- a/libgfortran/generated/eoshift3_8.c
+++ b/libgfortran/generated/eoshift3_8.c
@@ -100,8 +100,7 @@ eoshift3 (gfc_array_char * const restrict ret,
             str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
 	      * GFC_DESCRIPTOR_STRIDE(ret,i-1);
 
-	  GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(ret, i, 0, ub, str);
         }
       /* xmallocarray allocates a single byte for zero size.  */
       ret->base_addr = xmallocarray (arraysize, size);
diff --git a/libgfortran/generated/findloc0_c10.c b/libgfortran/generated/findloc0_c10.c
index 2ddbc45e898e..5b5b0e31daef 100644
--- a/libgfortran/generated/findloc0_c10.c
+++ b/libgfortran/generated/findloc0_c10.c
@@ -54,7 +54,7 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_c10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_c16.c b/libgfortran/generated/findloc0_c16.c
index a124091283f3..83d5c0e46c53 100644
--- a/libgfortran/generated/findloc0_c16.c
+++ b/libgfortran/generated/findloc0_c16.c
@@ -54,7 +54,7 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_c16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_c17.c b/libgfortran/generated/findloc0_c17.c
index a93a98e414a5..cc6205803630 100644
--- a/libgfortran/generated/findloc0_c17.c
+++ b/libgfortran/generated/findloc0_c17.c
@@ -54,7 +54,7 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_c17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_c4.c b/libgfortran/generated/findloc0_c4.c
index 04deab85ef7f..042a0be732fe 100644
--- a/libgfortran/generated/findloc0_c4.c
+++ b/libgfortran/generated/findloc0_c4.c
@@ -54,7 +54,7 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_c4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_c8.c b/libgfortran/generated/findloc0_c8.c
index bb3d59acc540..c928e30613a5 100644
--- a/libgfortran/generated/findloc0_c8.c
+++ b/libgfortran/generated/findloc0_c8.c
@@ -54,7 +54,7 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_c8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_i1.c b/libgfortran/generated/findloc0_i1.c
index 4a6162107257..f461b1d64449 100644
--- a/libgfortran/generated/findloc0_i1.c
+++ b/libgfortran/generated/findloc0_i1.c
@@ -54,7 +54,7 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_i1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_i16.c b/libgfortran/generated/findloc0_i16.c
index 73dd8b3a5e35..3daee388de26 100644
--- a/libgfortran/generated/findloc0_i16.c
+++ b/libgfortran/generated/findloc0_i16.c
@@ -54,7 +54,7 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_i16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_i2.c b/libgfortran/generated/findloc0_i2.c
index 76e8b4656869..66080fc10ea7 100644
--- a/libgfortran/generated/findloc0_i2.c
+++ b/libgfortran/generated/findloc0_i2.c
@@ -54,7 +54,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_i2 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_i4.c b/libgfortran/generated/findloc0_i4.c
index 50059ac664fb..9ece6a04f0db 100644
--- a/libgfortran/generated/findloc0_i4.c
+++ b/libgfortran/generated/findloc0_i4.c
@@ -54,7 +54,7 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_i4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_i8.c b/libgfortran/generated/findloc0_i8.c
index 44f9e2163622..d51818c92c2a 100644
--- a/libgfortran/generated/findloc0_i8.c
+++ b/libgfortran/generated/findloc0_i8.c
@@ -54,7 +54,7 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_i8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_r10.c b/libgfortran/generated/findloc0_r10.c
index ec35b0d3beaa..53014d2cdda2 100644
--- a/libgfortran/generated/findloc0_r10.c
+++ b/libgfortran/generated/findloc0_r10.c
@@ -54,7 +54,7 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_r10 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_r16.c b/libgfortran/generated/findloc0_r16.c
index 756c78c9a61e..4220fb41c5a3 100644
--- a/libgfortran/generated/findloc0_r16.c
+++ b/libgfortran/generated/findloc0_r16.c
@@ -54,7 +54,7 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_r16 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_r17.c b/libgfortran/generated/findloc0_r17.c
index ae93d01c2a89..5c09579d9087 100644
--- a/libgfortran/generated/findloc0_r17.c
+++ b/libgfortran/generated/findloc0_r17.c
@@ -54,7 +54,7 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_r17 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_r4.c b/libgfortran/generated/findloc0_r4.c
index 6564ae2a0874..4be93e94508a 100644
--- a/libgfortran/generated/findloc0_r4.c
+++ b/libgfortran/generated/findloc0_r4.c
@@ -54,7 +54,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_r4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_r8.c b/libgfortran/generated/findloc0_r8.c
index afba15f55c3d..e215854c55b0 100644
--- a/libgfortran/generated/findloc0_r8.c
+++ b/libgfortran/generated/findloc0_r8.c
@@ -54,7 +54,7 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -193,7 +193,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -355,7 +355,7 @@ sfindloc0_r8 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_s1.c b/libgfortran/generated/findloc0_s1.c
index 6ee5d059de58..8a64d306b27c 100644
--- a/libgfortran/generated/findloc0_s1.c
+++ b/libgfortran/generated/findloc0_s1.c
@@ -55,7 +55,7 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -196,7 +196,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -360,7 +360,7 @@ sfindloc0_s1 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc0_s4.c b/libgfortran/generated/findloc0_s4.c
index 1a69e7386a68..50b7f673f7e3 100644
--- a/libgfortran/generated/findloc0_s4.c
+++ b/libgfortran/generated/findloc0_s4.c
@@ -55,7 +55,7 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -196,7 +196,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
@@ -360,7 +360,7 @@ sfindloc0_s4 (gfc_array_index_type * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (index_type));
diff --git a/libgfortran/generated/findloc1_c10.c b/libgfortran/generated/findloc1_c10.c
index 852bf2678772..5fbd62258731 100644
--- a/libgfortran/generated/findloc1_c10.c
+++ b/libgfortran/generated/findloc1_c10.c
@@ -94,8 +94,7 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_c10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_c16.c b/libgfortran/generated/findloc1_c16.c
index f227a80895b9..caff5433572f 100644
--- a/libgfortran/generated/findloc1_c16.c
+++ b/libgfortran/generated/findloc1_c16.c
@@ -94,8 +94,7 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_c17.c b/libgfortran/generated/findloc1_c17.c
index 9912fc2bb1fd..533e9c623aee 100644
--- a/libgfortran/generated/findloc1_c17.c
+++ b/libgfortran/generated/findloc1_c17.c
@@ -94,8 +94,7 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_c17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_c4.c b/libgfortran/generated/findloc1_c4.c
index 554450323493..bf6b8c7f1960 100644
--- a/libgfortran/generated/findloc1_c4.c
+++ b/libgfortran/generated/findloc1_c4.c
@@ -94,8 +94,7 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_c8.c b/libgfortran/generated/findloc1_c8.c
index 1e88e407d921..aaa9d09df0c6 100644
--- a/libgfortran/generated/findloc1_c8.c
+++ b/libgfortran/generated/findloc1_c8.c
@@ -94,8 +94,7 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_i1.c b/libgfortran/generated/findloc1_i1.c
index bf856a273031..d5a50ee21afe 100644
--- a/libgfortran/generated/findloc1_i1.c
+++ b/libgfortran/generated/findloc1_i1.c
@@ -94,8 +94,7 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_i16.c b/libgfortran/generated/findloc1_i16.c
index cc935f768bfc..218f11d3fc82 100644
--- a/libgfortran/generated/findloc1_i16.c
+++ b/libgfortran/generated/findloc1_i16.c
@@ -94,8 +94,7 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_i2.c b/libgfortran/generated/findloc1_i2.c
index e2139536b74a..afc691f84c19 100644
--- a/libgfortran/generated/findloc1_i2.c
+++ b/libgfortran/generated/findloc1_i2.c
@@ -94,8 +94,7 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_i4.c b/libgfortran/generated/findloc1_i4.c
index f282132c5db6..e09184198b41 100644
--- a/libgfortran/generated/findloc1_i4.c
+++ b/libgfortran/generated/findloc1_i4.c
@@ -94,8 +94,7 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_i8.c b/libgfortran/generated/findloc1_i8.c
index 083e76a07cc3..ab23949eb23b 100644
--- a/libgfortran/generated/findloc1_i8.c
+++ b/libgfortran/generated/findloc1_i8.c
@@ -94,8 +94,7 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_r10.c b/libgfortran/generated/findloc1_r10.c
index 3e2bede8af01..195e656fbcf1 100644
--- a/libgfortran/generated/findloc1_r10.c
+++ b/libgfortran/generated/findloc1_r10.c
@@ -94,8 +94,7 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_r10 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_r16.c b/libgfortran/generated/findloc1_r16.c
index a1c7ed8139bd..4beecd583ae3 100644
--- a/libgfortran/generated/findloc1_r16.c
+++ b/libgfortran/generated/findloc1_r16.c
@@ -94,8 +94,7 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_r17.c b/libgfortran/generated/findloc1_r17.c
index d42ec6c88a99..ead93c21c4cf 100644
--- a/libgfortran/generated/findloc1_r17.c
+++ b/libgfortran/generated/findloc1_r17.c
@@ -94,8 +94,7 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_r17 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_r4.c b/libgfortran/generated/findloc1_r4.c
index a871b21397d9..146df049ad54 100644
--- a/libgfortran/generated/findloc1_r4.c
+++ b/libgfortran/generated/findloc1_r4.c
@@ -94,8 +94,7 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_r8.c b/libgfortran/generated/findloc1_r8.c
index e6b89c0aee8e..48fdc3668cd3 100644
--- a/libgfortran/generated/findloc1_r8.c
+++ b/libgfortran/generated/findloc1_r8.c
@@ -94,8 +94,7 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -278,8 +277,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -448,7 +446,7 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_s1.c b/libgfortran/generated/findloc1_s1.c
index a57da46614a1..a41fef8557c8 100644
--- a/libgfortran/generated/findloc1_s1.c
+++ b/libgfortran/generated/findloc1_s1.c
@@ -96,8 +96,7 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -280,8 +279,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -450,7 +448,7 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/findloc1_s4.c b/libgfortran/generated/findloc1_s4.c
index 2497d818b5a2..ce70d146d270 100644
--- a/libgfortran/generated/findloc1_s4.c
+++ b/libgfortran/generated/findloc1_s4.c
@@ -96,8 +96,7 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -280,8 +279,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -450,7 +448,7 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c
index 2e322c1f1953..e1b246536cf8 100644
--- a/libgfortran/generated/iall_i1.c
+++ b/libgfortran/generated/iall_i1.c
@@ -95,8 +95,7 @@ iall_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index c70b6982315d..087faeb9f22d 100644
--- a/libgfortran/generated/iall_i16.c
+++ b/libgfortran/generated/iall_i16.c
@@ -95,8 +95,7 @@ iall_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index bede3c37c526..5145a6deb22b 100644
--- a/libgfortran/generated/iall_i2.c
+++ b/libgfortran/generated/iall_i2.c
@@ -95,8 +95,7 @@ iall_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index 3e4370be7e35..234ed3ec7f62 100644
--- a/libgfortran/generated/iall_i4.c
+++ b/libgfortran/generated/iall_i4.c
@@ -95,8 +95,7 @@ iall_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index 1651a470748a..0e00cacb20ea 100644
--- a/libgfortran/generated/iall_i8.c
+++ b/libgfortran/generated/iall_i8.c
@@ -95,8 +95,7 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index a9b24f208c2b..1855635e37c0 100644
--- a/libgfortran/generated/iany_i1.c
+++ b/libgfortran/generated/iany_i1.c
@@ -95,8 +95,7 @@ iany_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index 34d0954bdf94..2d5b7bcb5171 100644
--- a/libgfortran/generated/iany_i16.c
+++ b/libgfortran/generated/iany_i16.c
@@ -95,8 +95,7 @@ iany_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index 554a0245603f..d332b3e02c72 100644
--- a/libgfortran/generated/iany_i2.c
+++ b/libgfortran/generated/iany_i2.c
@@ -95,8 +95,7 @@ iany_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index d4c824f6d145..6d42d19b384d 100644
--- a/libgfortran/generated/iany_i4.c
+++ b/libgfortran/generated/iany_i4.c
@@ -95,8 +95,7 @@ iany_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index cebeec24656d..d7af915c67fd 100644
--- a/libgfortran/generated/iany_i8.c
+++ b/libgfortran/generated/iany_i8.c
@@ -95,8 +95,7 @@ iany_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index b7cdb3e995f6..5457494e81ac 100644
--- a/libgfortran/generated/iparity_i1.c
+++ b/libgfortran/generated/iparity_i1.c
@@ -95,8 +95,7 @@ iparity_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index f6272638f2ef..db02387c9b93 100644
--- a/libgfortran/generated/iparity_i16.c
+++ b/libgfortran/generated/iparity_i16.c
@@ -95,8 +95,7 @@ iparity_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index 4481a04c2f88..b37c27bfacb6 100644
--- a/libgfortran/generated/iparity_i2.c
+++ b/libgfortran/generated/iparity_i2.c
@@ -95,8 +95,7 @@ iparity_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index e0c65dd207b0..08d1635af407 100644
--- a/libgfortran/generated/iparity_i4.c
+++ b/libgfortran/generated/iparity_i4.c
@@ -95,8 +95,7 @@ iparity_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index f2feec9fae8a..5b94641d8f5e 100644
--- a/libgfortran/generated/iparity_i8.c
+++ b/libgfortran/generated/iparity_i8.c
@@ -95,8 +95,7 @@ iparity_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -287,8 +286,7 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -446,8 +444,7 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c
index 07432e83c916..5b71bf0c2915 100644
--- a/libgfortran/generated/matmul_c10.c
+++ b/libgfortran/generated/matmul_c10.c
@@ -113,22 +113,22 @@ matmul_c10_avx (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_c10_avx2 (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_c10_avx512f (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_c10_vanilla (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_c16.c b/libgfortran/generated/matmul_c16.c
index 03ffe2d0de10..aaef220ce477 100644
--- a/libgfortran/generated/matmul_c16.c
+++ b/libgfortran/generated/matmul_c16.c
@@ -113,22 +113,22 @@ matmul_c16_avx (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_c16_avx2 (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_c16_avx512f (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_c16_vanilla (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_c17.c b/libgfortran/generated/matmul_c17.c
index 22931489b213..061eb430dd87 100644
--- a/libgfortran/generated/matmul_c17.c
+++ b/libgfortran/generated/matmul_c17.c
@@ -113,22 +113,22 @@ matmul_c17_avx (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_c17_avx2 (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_c17_avx512f (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_c17_vanilla (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_c17 (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c
index 20d8affd9f57..79cf933d289f 100644
--- a/libgfortran/generated/matmul_c4.c
+++ b/libgfortran/generated/matmul_c4.c
@@ -113,22 +113,22 @@ matmul_c4_avx (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_c4_avx2 (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_c4_avx512f (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_c4_vanilla (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c
index 1919963cf387..674df86903f6 100644
--- a/libgfortran/generated/matmul_c8.c
+++ b/libgfortran/generated/matmul_c8.c
@@ -113,22 +113,22 @@ matmul_c8_avx (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_c8_avx2 (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_c8_avx512f (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_c8_vanilla (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_i1.c b/libgfortran/generated/matmul_i1.c
index 526755d94a2b..742081175670 100644
--- a/libgfortran/generated/matmul_i1.c
+++ b/libgfortran/generated/matmul_i1.c
@@ -113,22 +113,22 @@ matmul_i1_avx (gfc_array_m1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_i1_avx2 (gfc_array_m1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_i1_avx512f (gfc_array_m1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_i1_vanilla (gfc_array_m1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_i1 (gfc_array_m1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_i16.c b/libgfortran/generated/matmul_i16.c
index e47299944982..221ff4978d54 100644
--- a/libgfortran/generated/matmul_i16.c
+++ b/libgfortran/generated/matmul_i16.c
@@ -113,22 +113,22 @@ matmul_i16_avx (gfc_array_m16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_i16_avx2 (gfc_array_m16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_i16_avx512f (gfc_array_m16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_i16_vanilla (gfc_array_m16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_i16 (gfc_array_m16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_i2.c b/libgfortran/generated/matmul_i2.c
index 1b9e34b4f68b..f7486deaf7bf 100644
--- a/libgfortran/generated/matmul_i2.c
+++ b/libgfortran/generated/matmul_i2.c
@@ -113,22 +113,22 @@ matmul_i2_avx (gfc_array_m2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_i2_avx2 (gfc_array_m2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_i2_avx512f (gfc_array_m2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_i2_vanilla (gfc_array_m2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_i2 (gfc_array_m2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c
index b14fafb5b0c1..be01277bc315 100644
--- a/libgfortran/generated/matmul_i4.c
+++ b/libgfortran/generated/matmul_i4.c
@@ -113,22 +113,22 @@ matmul_i4_avx (gfc_array_m4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_i4_avx2 (gfc_array_m4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_i4_avx512f (gfc_array_m4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_i4_vanilla (gfc_array_m4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_i4 (gfc_array_m4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c
index 1ec49ce3bb44..8ebdd81486b3 100644
--- a/libgfortran/generated/matmul_i8.c
+++ b/libgfortran/generated/matmul_i8.c
@@ -113,22 +113,22 @@ matmul_i8_avx (gfc_array_m8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_i8_avx2 (gfc_array_m8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_i8_avx512f (gfc_array_m8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_i8_vanilla (gfc_array_m8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_i8 (gfc_array_m8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_l16.c b/libgfortran/generated/matmul_l16.c
index 193502eff6d1..cea6a2483e51 100644
--- a/libgfortran/generated/matmul_l16.c
+++ b/libgfortran/generated/matmul_l16.c
@@ -68,22 +68,22 @@ matmul_l16 (gfc_array_l16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
           
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_l4.c b/libgfortran/generated/matmul_l4.c
index bc0e2e192bfd..6775e228c806 100644
--- a/libgfortran/generated/matmul_l4.c
+++ b/libgfortran/generated/matmul_l4.c
@@ -68,22 +68,22 @@ matmul_l4 (gfc_array_l4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
           
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_l8.c b/libgfortran/generated/matmul_l8.c
index d505b83c9d63..b9df372604d9 100644
--- a/libgfortran/generated/matmul_l8.c
+++ b/libgfortran/generated/matmul_l8.c
@@ -68,22 +68,22 @@ matmul_l8 (gfc_array_l8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
           
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_r10.c b/libgfortran/generated/matmul_r10.c
index 755ebaed7d4e..206bcafcd7a9 100644
--- a/libgfortran/generated/matmul_r10.c
+++ b/libgfortran/generated/matmul_r10.c
@@ -113,22 +113,22 @@ matmul_r10_avx (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_r10_avx2 (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_r10_avx512f (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_r10_vanilla (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_r16.c b/libgfortran/generated/matmul_r16.c
index e91b220ffb45..de0223f312f3 100644
--- a/libgfortran/generated/matmul_r16.c
+++ b/libgfortran/generated/matmul_r16.c
@@ -113,22 +113,22 @@ matmul_r16_avx (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_r16_avx2 (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_r16_avx512f (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_r16_vanilla (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_r17.c b/libgfortran/generated/matmul_r17.c
index 0d00be6c1945..801914c0b3ec 100644
--- a/libgfortran/generated/matmul_r17.c
+++ b/libgfortran/generated/matmul_r17.c
@@ -113,22 +113,22 @@ matmul_r17_avx (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_r17_avx2 (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_r17_avx512f (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_r17_vanilla (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_r17 (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c
index 458ebc368127..402afdaf43a9 100644
--- a/libgfortran/generated/matmul_r4.c
+++ b/libgfortran/generated/matmul_r4.c
@@ -113,22 +113,22 @@ matmul_r4_avx (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_r4_avx2 (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_r4_avx512f (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_r4_vanilla (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c
index 225b5c664f4d..e1740c88719d 100644
--- a/libgfortran/generated/matmul_r8.c
+++ b/libgfortran/generated/matmul_r8.c
@@ -113,22 +113,22 @@ matmul_r8_avx (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -682,22 +682,22 @@ matmul_r8_avx2 (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1251,22 +1251,22 @@ matmul_r8_avx512f (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -1834,22 +1834,22 @@ matmul_r8_vanilla (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -2476,22 +2476,22 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_c10.c b/libgfortran/generated/matmulavx128_c10.c
index 6e084809027d..406e376d1826 100644
--- a/libgfortran/generated/matmulavx128_c10.c
+++ b/libgfortran/generated/matmulavx128_c10.c
@@ -78,22 +78,22 @@ matmul_c10_avx128_fma3 (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_c10_avx128_fma4 (gfc_array_c10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_c16.c b/libgfortran/generated/matmulavx128_c16.c
index 57d24ec0b586..6072617d3819 100644
--- a/libgfortran/generated/matmulavx128_c16.c
+++ b/libgfortran/generated/matmulavx128_c16.c
@@ -78,22 +78,22 @@ matmul_c16_avx128_fma3 (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_c16_avx128_fma4 (gfc_array_c16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_c17.c b/libgfortran/generated/matmulavx128_c17.c
index 7d54c0dc655f..af1c95bc107c 100644
--- a/libgfortran/generated/matmulavx128_c17.c
+++ b/libgfortran/generated/matmulavx128_c17.c
@@ -78,22 +78,22 @@ matmul_c17_avx128_fma3 (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_c17_avx128_fma4 (gfc_array_c17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_c4.c b/libgfortran/generated/matmulavx128_c4.c
index a7708c5a1f74..41ef2e00ea2e 100644
--- a/libgfortran/generated/matmulavx128_c4.c
+++ b/libgfortran/generated/matmulavx128_c4.c
@@ -78,22 +78,22 @@ matmul_c4_avx128_fma3 (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_c4_avx128_fma4 (gfc_array_c4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_c8.c b/libgfortran/generated/matmulavx128_c8.c
index b0d325fba595..360f89ec97e4 100644
--- a/libgfortran/generated/matmulavx128_c8.c
+++ b/libgfortran/generated/matmulavx128_c8.c
@@ -78,22 +78,22 @@ matmul_c8_avx128_fma3 (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_c8_avx128_fma4 (gfc_array_c8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_i1.c b/libgfortran/generated/matmulavx128_i1.c
index f5e5befad90b..9a9c3bb2e74f 100644
--- a/libgfortran/generated/matmulavx128_i1.c
+++ b/libgfortran/generated/matmulavx128_i1.c
@@ -78,22 +78,22 @@ matmul_i1_avx128_fma3 (gfc_array_i1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_i1_avx128_fma4 (gfc_array_i1 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_i16.c b/libgfortran/generated/matmulavx128_i16.c
index f686f7ad44cc..8ca84818c100 100644
--- a/libgfortran/generated/matmulavx128_i16.c
+++ b/libgfortran/generated/matmulavx128_i16.c
@@ -78,22 +78,22 @@ matmul_i16_avx128_fma3 (gfc_array_i16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_i16_avx128_fma4 (gfc_array_i16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_i2.c b/libgfortran/generated/matmulavx128_i2.c
index f6a162d1e416..9f4d20dbc89f 100644
--- a/libgfortran/generated/matmulavx128_i2.c
+++ b/libgfortran/generated/matmulavx128_i2.c
@@ -78,22 +78,22 @@ matmul_i2_avx128_fma3 (gfc_array_i2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_i2_avx128_fma4 (gfc_array_i2 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_i4.c b/libgfortran/generated/matmulavx128_i4.c
index 0a28e4ba0593..8b609d8bdcf3 100644
--- a/libgfortran/generated/matmulavx128_i4.c
+++ b/libgfortran/generated/matmulavx128_i4.c
@@ -78,22 +78,22 @@ matmul_i4_avx128_fma3 (gfc_array_i4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_i4_avx128_fma4 (gfc_array_i4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_i8.c b/libgfortran/generated/matmulavx128_i8.c
index a077a26a701d..592005621d15 100644
--- a/libgfortran/generated/matmulavx128_i8.c
+++ b/libgfortran/generated/matmulavx128_i8.c
@@ -78,22 +78,22 @@ matmul_i8_avx128_fma3 (gfc_array_i8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_i8_avx128_fma4 (gfc_array_i8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_r10.c b/libgfortran/generated/matmulavx128_r10.c
index 31c62bab4b71..91c483b2c563 100644
--- a/libgfortran/generated/matmulavx128_r10.c
+++ b/libgfortran/generated/matmulavx128_r10.c
@@ -78,22 +78,22 @@ matmul_r10_avx128_fma3 (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_r10_avx128_fma4 (gfc_array_r10 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_r16.c b/libgfortran/generated/matmulavx128_r16.c
index 1ed5516d1ed7..d2629e3128d5 100644
--- a/libgfortran/generated/matmulavx128_r16.c
+++ b/libgfortran/generated/matmulavx128_r16.c
@@ -78,22 +78,22 @@ matmul_r16_avx128_fma3 (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_r16_avx128_fma4 (gfc_array_r16 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_r17.c b/libgfortran/generated/matmulavx128_r17.c
index f1e58521204c..1bed3958b2e5 100644
--- a/libgfortran/generated/matmulavx128_r17.c
+++ b/libgfortran/generated/matmulavx128_r17.c
@@ -78,22 +78,22 @@ matmul_r17_avx128_fma3 (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_r17_avx128_fma4 (gfc_array_r17 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_r4.c b/libgfortran/generated/matmulavx128_r4.c
index 5372623c65d3..8bebcfed128d 100644
--- a/libgfortran/generated/matmulavx128_r4.c
+++ b/libgfortran/generated/matmulavx128_r4.c
@@ -78,22 +78,22 @@ matmul_r4_avx128_fma3 (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_r4_avx128_fma4 (gfc_array_r4 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/matmulavx128_r8.c b/libgfortran/generated/matmulavx128_r8.c
index ee7bc4a28ab8..bd28ebd22692 100644
--- a/libgfortran/generated/matmulavx128_r8.c
+++ b/libgfortran/generated/matmulavx128_r8.c
@@ -78,22 +78,22 @@ matmul_r8_avx128_fma3 (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
@@ -648,22 +648,22 @@ matmul_r8_avx128_fma4 (gfc_array_r8 * const restrict retarray,
     {
       if (GFC_DESCRIPTOR_RANK (a) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1, 1);
         }
       else if (GFC_DESCRIPTOR_RANK (b) == 1)
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
         }
       else
         {
-	  GFC_DIMENSION_SET(retarray->dim[0], 0,
-	                    GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0,
+				       GFC_DESCRIPTOR_EXTENT(a,0) - 1, 1);
 
-          GFC_DIMENSION_SET(retarray->dim[1], 0,
-	                    GFC_DESCRIPTOR_EXTENT(b,1) - 1,
-			    GFC_DESCRIPTOR_EXTENT(retarray,0));
+          GFC_DESCRIPTOR_DIMENSION_SET(retarray, 1, 0,
+				       GFC_DESCRIPTOR_EXTENT(b,1) - 1,
+				       GFC_DESCRIPTOR_EXTENT(retarray,0));
         }
 
       retarray->base_addr
diff --git a/libgfortran/generated/maxloc0_16_i1.c b/libgfortran/generated/maxloc0_16_i1.c
index 770238a41ab2..b744f3d92927 100644
--- a/libgfortran/generated/maxloc0_16_i1.c
+++ b/libgfortran/generated/maxloc0_16_i1.c
@@ -53,7 +53,7 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_i16.c b/libgfortran/generated/maxloc0_16_i16.c
index c0e553435107..0d4ca049019a 100644
--- a/libgfortran/generated/maxloc0_16_i16.c
+++ b/libgfortran/generated/maxloc0_16_i16.c
@@ -53,7 +53,7 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_i2.c b/libgfortran/generated/maxloc0_16_i2.c
index 3d37f3ac98a3..ac1a992a79d7 100644
--- a/libgfortran/generated/maxloc0_16_i2.c
+++ b/libgfortran/generated/maxloc0_16_i2.c
@@ -53,7 +53,7 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_i4.c b/libgfortran/generated/maxloc0_16_i4.c
index 0efc69b2ec47..bf8d53307928 100644
--- a/libgfortran/generated/maxloc0_16_i4.c
+++ b/libgfortran/generated/maxloc0_16_i4.c
@@ -53,7 +53,7 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_i8.c b/libgfortran/generated/maxloc0_16_i8.c
index d7267103d5b0..63c07a0dbda3 100644
--- a/libgfortran/generated/maxloc0_16_i8.c
+++ b/libgfortran/generated/maxloc0_16_i8.c
@@ -53,7 +53,7 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_m1.c b/libgfortran/generated/maxloc0_16_m1.c
index 2a47b9ebc125..33286ffed5e5 100644
--- a/libgfortran/generated/maxloc0_16_m1.c
+++ b/libgfortran/generated/maxloc0_16_m1.c
@@ -53,7 +53,7 @@ maxloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_m16.c b/libgfortran/generated/maxloc0_16_m16.c
index 1003fdb7251a..682144254126 100644
--- a/libgfortran/generated/maxloc0_16_m16.c
+++ b/libgfortran/generated/maxloc0_16_m16.c
@@ -53,7 +53,7 @@ maxloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_m2.c b/libgfortran/generated/maxloc0_16_m2.c
index 49b92f7eb98d..d2b1ec6910a1 100644
--- a/libgfortran/generated/maxloc0_16_m2.c
+++ b/libgfortran/generated/maxloc0_16_m2.c
@@ -53,7 +53,7 @@ maxloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_m4.c b/libgfortran/generated/maxloc0_16_m4.c
index 0144125709be..133b9ed4481c 100644
--- a/libgfortran/generated/maxloc0_16_m4.c
+++ b/libgfortran/generated/maxloc0_16_m4.c
@@ -53,7 +53,7 @@ maxloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_m8.c b/libgfortran/generated/maxloc0_16_m8.c
index 96d6295e5c5c..5f5074f5dbf8 100644
--- a/libgfortran/generated/maxloc0_16_m8.c
+++ b/libgfortran/generated/maxloc0_16_m8.c
@@ -53,7 +53,7 @@ maxloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_r10.c b/libgfortran/generated/maxloc0_16_r10.c
index 2469dbb78162..476375298c81 100644
--- a/libgfortran/generated/maxloc0_16_r10.c
+++ b/libgfortran/generated/maxloc0_16_r10.c
@@ -53,7 +53,7 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_r16.c b/libgfortran/generated/maxloc0_16_r16.c
index f7270435e915..a801c2df4627 100644
--- a/libgfortran/generated/maxloc0_16_r16.c
+++ b/libgfortran/generated/maxloc0_16_r16.c
@@ -53,7 +53,7 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_r17.c b/libgfortran/generated/maxloc0_16_r17.c
index e73d6c9de1a6..187d5169870b 100644
--- a/libgfortran/generated/maxloc0_16_r17.c
+++ b/libgfortran/generated/maxloc0_16_r17.c
@@ -53,7 +53,7 @@ maxloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_r4.c b/libgfortran/generated/maxloc0_16_r4.c
index 824a603198e9..0b0209c3e731 100644
--- a/libgfortran/generated/maxloc0_16_r4.c
+++ b/libgfortran/generated/maxloc0_16_r4.c
@@ -53,7 +53,7 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_r8.c b/libgfortran/generated/maxloc0_16_r8.c
index a1086877d91b..cda7799b3fa3 100644
--- a/libgfortran/generated/maxloc0_16_r8.c
+++ b/libgfortran/generated/maxloc0_16_r8.c
@@ -53,7 +53,7 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -389,7 +389,7 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_s1.c b/libgfortran/generated/maxloc0_16_s1.c
index 59f1ca5ced16..8fbbae5784df 100644
--- a/libgfortran/generated/maxloc0_16_s1.c
+++ b/libgfortran/generated/maxloc0_16_s1.c
@@ -67,7 +67,7 @@ maxloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -190,7 +190,7 @@ mmaxloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -331,7 +331,7 @@ smaxloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_16_s4.c b/libgfortran/generated/maxloc0_16_s4.c
index fe2b78545a47..1291c38b3b01 100644
--- a/libgfortran/generated/maxloc0_16_s4.c
+++ b/libgfortran/generated/maxloc0_16_s4.c
@@ -67,7 +67,7 @@ maxloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -190,7 +190,7 @@ mmaxloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -331,7 +331,7 @@ smaxloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/maxloc0_4_i1.c b/libgfortran/generated/maxloc0_4_i1.c
index 0af38ac3a547..0dcf292a87f6 100644
--- a/libgfortran/generated/maxloc0_4_i1.c
+++ b/libgfortran/generated/maxloc0_4_i1.c
@@ -53,7 +53,7 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_i16.c b/libgfortran/generated/maxloc0_4_i16.c
index 324865ff742e..23125c107cfd 100644
--- a/libgfortran/generated/maxloc0_4_i16.c
+++ b/libgfortran/generated/maxloc0_4_i16.c
@@ -53,7 +53,7 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_i2.c b/libgfortran/generated/maxloc0_4_i2.c
index 4ee24587da7b..c66db0f115ca 100644
--- a/libgfortran/generated/maxloc0_4_i2.c
+++ b/libgfortran/generated/maxloc0_4_i2.c
@@ -53,7 +53,7 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c
index a76778eed7c1..95f1a6c9af47 100644
--- a/libgfortran/generated/maxloc0_4_i4.c
+++ b/libgfortran/generated/maxloc0_4_i4.c
@@ -53,7 +53,7 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c
index 9bf8b408e0d4..20d8e9a4f109 100644
--- a/libgfortran/generated/maxloc0_4_i8.c
+++ b/libgfortran/generated/maxloc0_4_i8.c
@@ -53,7 +53,7 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_m1.c b/libgfortran/generated/maxloc0_4_m1.c
index 782595234711..e0764cc6ec5a 100644
--- a/libgfortran/generated/maxloc0_4_m1.c
+++ b/libgfortran/generated/maxloc0_4_m1.c
@@ -53,7 +53,7 @@ maxloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_m16.c b/libgfortran/generated/maxloc0_4_m16.c
index 4e90c491d63a..eda3a7b6d49b 100644
--- a/libgfortran/generated/maxloc0_4_m16.c
+++ b/libgfortran/generated/maxloc0_4_m16.c
@@ -53,7 +53,7 @@ maxloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_m2.c b/libgfortran/generated/maxloc0_4_m2.c
index b6b530bed636..5f2fe09feb67 100644
--- a/libgfortran/generated/maxloc0_4_m2.c
+++ b/libgfortran/generated/maxloc0_4_m2.c
@@ -53,7 +53,7 @@ maxloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_m4.c b/libgfortran/generated/maxloc0_4_m4.c
index b3ee5af083be..c17a2bb54d31 100644
--- a/libgfortran/generated/maxloc0_4_m4.c
+++ b/libgfortran/generated/maxloc0_4_m4.c
@@ -53,7 +53,7 @@ maxloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_m8.c b/libgfortran/generated/maxloc0_4_m8.c
index 4f7ec059f965..39f578313a29 100644
--- a/libgfortran/generated/maxloc0_4_m8.c
+++ b/libgfortran/generated/maxloc0_4_m8.c
@@ -53,7 +53,7 @@ maxloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_r10.c b/libgfortran/generated/maxloc0_4_r10.c
index 8b2943114ab3..c8d5f6b3949f 100644
--- a/libgfortran/generated/maxloc0_4_r10.c
+++ b/libgfortran/generated/maxloc0_4_r10.c
@@ -53,7 +53,7 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_r16.c b/libgfortran/generated/maxloc0_4_r16.c
index caf56a40728a..24a0e265eb2d 100644
--- a/libgfortran/generated/maxloc0_4_r16.c
+++ b/libgfortran/generated/maxloc0_4_r16.c
@@ -53,7 +53,7 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_r17.c b/libgfortran/generated/maxloc0_4_r17.c
index ed7710388dab..7e9d751bace0 100644
--- a/libgfortran/generated/maxloc0_4_r17.c
+++ b/libgfortran/generated/maxloc0_4_r17.c
@@ -53,7 +53,7 @@ maxloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c
index bc52f9d851f3..aefb96338e9e 100644
--- a/libgfortran/generated/maxloc0_4_r4.c
+++ b/libgfortran/generated/maxloc0_4_r4.c
@@ -53,7 +53,7 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c
index dac48d3ae4af..5295f1bf7533 100644
--- a/libgfortran/generated/maxloc0_4_r8.c
+++ b/libgfortran/generated/maxloc0_4_r8.c
@@ -53,7 +53,7 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -389,7 +389,7 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_s1.c b/libgfortran/generated/maxloc0_4_s1.c
index 60f42159169d..d02e4eaf5a33 100644
--- a/libgfortran/generated/maxloc0_4_s1.c
+++ b/libgfortran/generated/maxloc0_4_s1.c
@@ -67,7 +67,7 @@ maxloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -190,7 +190,7 @@ mmaxloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -331,7 +331,7 @@ smaxloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_4_s4.c b/libgfortran/generated/maxloc0_4_s4.c
index 19596ce43fe4..0bfe00aae2d0 100644
--- a/libgfortran/generated/maxloc0_4_s4.c
+++ b/libgfortran/generated/maxloc0_4_s4.c
@@ -67,7 +67,7 @@ maxloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -190,7 +190,7 @@ mmaxloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -331,7 +331,7 @@ smaxloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/maxloc0_8_i1.c b/libgfortran/generated/maxloc0_8_i1.c
index fb0f3e68205b..c5847c6c3abd 100644
--- a/libgfortran/generated/maxloc0_8_i1.c
+++ b/libgfortran/generated/maxloc0_8_i1.c
@@ -53,7 +53,7 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_i16.c b/libgfortran/generated/maxloc0_8_i16.c
index c6c33a08a2e8..ab111cb3347d 100644
--- a/libgfortran/generated/maxloc0_8_i16.c
+++ b/libgfortran/generated/maxloc0_8_i16.c
@@ -53,7 +53,7 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_i2.c b/libgfortran/generated/maxloc0_8_i2.c
index 19f9b82e0012..723fbaac859e 100644
--- a/libgfortran/generated/maxloc0_8_i2.c
+++ b/libgfortran/generated/maxloc0_8_i2.c
@@ -53,7 +53,7 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c
index de45fd2f43ac..e8480e14e746 100644
--- a/libgfortran/generated/maxloc0_8_i4.c
+++ b/libgfortran/generated/maxloc0_8_i4.c
@@ -53,7 +53,7 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c
index fd5d2ab91f73..485d6b4208c1 100644
--- a/libgfortran/generated/maxloc0_8_i8.c
+++ b/libgfortran/generated/maxloc0_8_i8.c
@@ -53,7 +53,7 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_m1.c b/libgfortran/generated/maxloc0_8_m1.c
index 2b4b0e7fcbec..29accbec92b6 100644
--- a/libgfortran/generated/maxloc0_8_m1.c
+++ b/libgfortran/generated/maxloc0_8_m1.c
@@ -53,7 +53,7 @@ maxloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_m16.c b/libgfortran/generated/maxloc0_8_m16.c
index da03132c2e8b..92abeea350f7 100644
--- a/libgfortran/generated/maxloc0_8_m16.c
+++ b/libgfortran/generated/maxloc0_8_m16.c
@@ -53,7 +53,7 @@ maxloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_m2.c b/libgfortran/generated/maxloc0_8_m2.c
index 0c7b74c06f80..6673551cefb9 100644
--- a/libgfortran/generated/maxloc0_8_m2.c
+++ b/libgfortran/generated/maxloc0_8_m2.c
@@ -53,7 +53,7 @@ maxloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_m4.c b/libgfortran/generated/maxloc0_8_m4.c
index 307a04b697c6..1655ee244996 100644
--- a/libgfortran/generated/maxloc0_8_m4.c
+++ b/libgfortran/generated/maxloc0_8_m4.c
@@ -53,7 +53,7 @@ maxloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_m8.c b/libgfortran/generated/maxloc0_8_m8.c
index 5160418c8d95..325a0fe29601 100644
--- a/libgfortran/generated/maxloc0_8_m8.c
+++ b/libgfortran/generated/maxloc0_8_m8.c
@@ -53,7 +53,7 @@ maxloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_r10.c b/libgfortran/generated/maxloc0_8_r10.c
index 09a9145f8dea..7bcea7cd2e38 100644
--- a/libgfortran/generated/maxloc0_8_r10.c
+++ b/libgfortran/generated/maxloc0_8_r10.c
@@ -53,7 +53,7 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c
index b33713f016e8..6ad254bedbff 100644
--- a/libgfortran/generated/maxloc0_8_r16.c
+++ b/libgfortran/generated/maxloc0_8_r16.c
@@ -53,7 +53,7 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_r17.c b/libgfortran/generated/maxloc0_8_r17.c
index c008861d0633..da4a8afe446b 100644
--- a/libgfortran/generated/maxloc0_8_r17.c
+++ b/libgfortran/generated/maxloc0_8_r17.c
@@ -53,7 +53,7 @@ maxloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c
index f2216a7b2421..1aff2de92bb1 100644
--- a/libgfortran/generated/maxloc0_8_r4.c
+++ b/libgfortran/generated/maxloc0_8_r4.c
@@ -53,7 +53,7 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c
index b54fd05e6a39..8989c8380fc8 100644
--- a/libgfortran/generated/maxloc0_8_r8.c
+++ b/libgfortran/generated/maxloc0_8_r8.c
@@ -53,7 +53,7 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -389,7 +389,7 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_s1.c b/libgfortran/generated/maxloc0_8_s1.c
index 79780fbabc0e..b9b51cba0253 100644
--- a/libgfortran/generated/maxloc0_8_s1.c
+++ b/libgfortran/generated/maxloc0_8_s1.c
@@ -67,7 +67,7 @@ maxloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -190,7 +190,7 @@ mmaxloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -331,7 +331,7 @@ smaxloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc0_8_s4.c b/libgfortran/generated/maxloc0_8_s4.c
index 36943006fdd7..a014338fa578 100644
--- a/libgfortran/generated/maxloc0_8_s4.c
+++ b/libgfortran/generated/maxloc0_8_s4.c
@@ -67,7 +67,7 @@ maxloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -190,7 +190,7 @@ mmaxloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -331,7 +331,7 @@ smaxloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index 31e17c443e8e..57556c76e5c0 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -98,8 +98,7 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 227ab99fecdf..ec049ccab29b 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -98,8 +98,7 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 40fbf8bf153f..43734bc342a9 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -98,8 +98,7 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 28f1f4f743fd..c04c2332aa98 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -98,8 +98,7 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index ee97c1ac552d..9552fc38dd5d 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -98,8 +98,7 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_m1.c b/libgfortran/generated/maxloc1_16_m1.c
index 4d78e75f3349..e8ab37977d68 100644
--- a/libgfortran/generated/maxloc1_16_m1.c
+++ b/libgfortran/generated/maxloc1_16_m1.c
@@ -98,8 +98,7 @@ maxloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_m16.c b/libgfortran/generated/maxloc1_16_m16.c
index e6f1ae3607b6..1d08de92d288 100644
--- a/libgfortran/generated/maxloc1_16_m16.c
+++ b/libgfortran/generated/maxloc1_16_m16.c
@@ -98,8 +98,7 @@ maxloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_m2.c b/libgfortran/generated/maxloc1_16_m2.c
index 8bb48ddaeba7..ae2d5bc0e534 100644
--- a/libgfortran/generated/maxloc1_16_m2.c
+++ b/libgfortran/generated/maxloc1_16_m2.c
@@ -98,8 +98,7 @@ maxloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_m4.c b/libgfortran/generated/maxloc1_16_m4.c
index 659d6cf6abb9..672f7acff2cd 100644
--- a/libgfortran/generated/maxloc1_16_m4.c
+++ b/libgfortran/generated/maxloc1_16_m4.c
@@ -98,8 +98,7 @@ maxloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_m8.c b/libgfortran/generated/maxloc1_16_m8.c
index a6d2c08a5608..56e3838306fc 100644
--- a/libgfortran/generated/maxloc1_16_m8.c
+++ b/libgfortran/generated/maxloc1_16_m8.c
@@ -98,8 +98,7 @@ maxloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index 87b56477149c..3b5e8c79b7ce 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -98,8 +98,7 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index 2bc6edb85bfa..b4330f487795 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -98,8 +98,7 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_r17.c b/libgfortran/generated/maxloc1_16_r17.c
index ce5259897199..13720c38ff3a 100644
--- a/libgfortran/generated/maxloc1_16_r17.c
+++ b/libgfortran/generated/maxloc1_16_r17.c
@@ -98,8 +98,7 @@ maxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index 5ae022f0b34f..f2eeee4bdd1f 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -98,8 +98,7 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index cf2e12643be0..2454f0d7a262 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -98,8 +98,7 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c
index 21ea81a1aac3..0deb10965f47 100644
--- a/libgfortran/generated/maxloc1_16_s1.c
+++ b/libgfortran/generated/maxloc1_16_s1.c
@@ -110,8 +110,7 @@ maxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c
index 47e14c148bd4..5f8cd832a757 100644
--- a/libgfortran/generated/maxloc1_16_s4.c
+++ b/libgfortran/generated/maxloc1_16_s4.c
@@ -110,8 +110,7 @@ maxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index a54feb4afbd5..d75729552f2e 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -98,8 +98,7 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index cb866c0c4298..ad3ed6cfcafc 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -98,8 +98,7 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index 45aa9a1e9cd9..bd18c0556a1b 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -98,8 +98,7 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index ae966d8f76ad..5f623395981e 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -98,8 +98,7 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index 31bff23b6200..5da449aa93ba 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -98,8 +98,7 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_m1.c b/libgfortran/generated/maxloc1_4_m1.c
index 709a1ddd38af..11dbc0e6aae6 100644
--- a/libgfortran/generated/maxloc1_4_m1.c
+++ b/libgfortran/generated/maxloc1_4_m1.c
@@ -98,8 +98,7 @@ maxloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_m16.c b/libgfortran/generated/maxloc1_4_m16.c
index cc10527a49a2..60c240d45997 100644
--- a/libgfortran/generated/maxloc1_4_m16.c
+++ b/libgfortran/generated/maxloc1_4_m16.c
@@ -98,8 +98,7 @@ maxloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_m2.c b/libgfortran/generated/maxloc1_4_m2.c
index 06f989cee5d1..2d9aa300a723 100644
--- a/libgfortran/generated/maxloc1_4_m2.c
+++ b/libgfortran/generated/maxloc1_4_m2.c
@@ -98,8 +98,7 @@ maxloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_m4.c b/libgfortran/generated/maxloc1_4_m4.c
index 6a52a0a2f439..f885535f1aa8 100644
--- a/libgfortran/generated/maxloc1_4_m4.c
+++ b/libgfortran/generated/maxloc1_4_m4.c
@@ -98,8 +98,7 @@ maxloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_m8.c b/libgfortran/generated/maxloc1_4_m8.c
index e2f92a9a2125..4493f46d11d9 100644
--- a/libgfortran/generated/maxloc1_4_m8.c
+++ b/libgfortran/generated/maxloc1_4_m8.c
@@ -98,8 +98,7 @@ maxloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index fdab04271143..7099bdb23dd1 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -98,8 +98,7 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index 9eedf782116e..44ce31bdab51 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -98,8 +98,7 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_r17.c b/libgfortran/generated/maxloc1_4_r17.c
index 516268e4beb0..8effbf554eb4 100644
--- a/libgfortran/generated/maxloc1_4_r17.c
+++ b/libgfortran/generated/maxloc1_4_r17.c
@@ -98,8 +98,7 @@ maxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 1ccc30ca4cc8..43d197337d9f 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -98,8 +98,7 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index 86da06456cbc..a5539e899584 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -98,8 +98,7 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c
index 66ee8d0f1dbc..b16f0692cd9f 100644
--- a/libgfortran/generated/maxloc1_4_s1.c
+++ b/libgfortran/generated/maxloc1_4_s1.c
@@ -110,8 +110,7 @@ maxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c
index 7d889c00596e..42fcc1b2c24d 100644
--- a/libgfortran/generated/maxloc1_4_s4.c
+++ b/libgfortran/generated/maxloc1_4_s4.c
@@ -110,8 +110,7 @@ maxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index bb745335bc98..000117b60a20 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -98,8 +98,7 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 6e8061a18bf6..694b44fff1ad 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -98,8 +98,7 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index ed4fda52494e..46181371c92c 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -98,8 +98,7 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index 4c708311b617..0fe5e55a159c 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -98,8 +98,7 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index d0c34950fff4..14307f865d71 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -98,8 +98,7 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_m1.c b/libgfortran/generated/maxloc1_8_m1.c
index 2f2ff5ad0a04..b655809ad1f7 100644
--- a/libgfortran/generated/maxloc1_8_m1.c
+++ b/libgfortran/generated/maxloc1_8_m1.c
@@ -98,8 +98,7 @@ maxloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_m16.c b/libgfortran/generated/maxloc1_8_m16.c
index c0c47bb16d60..45ce56858483 100644
--- a/libgfortran/generated/maxloc1_8_m16.c
+++ b/libgfortran/generated/maxloc1_8_m16.c
@@ -98,8 +98,7 @@ maxloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_m2.c b/libgfortran/generated/maxloc1_8_m2.c
index cf915b07b48a..22d59ede4d3a 100644
--- a/libgfortran/generated/maxloc1_8_m2.c
+++ b/libgfortran/generated/maxloc1_8_m2.c
@@ -98,8 +98,7 @@ maxloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_m4.c b/libgfortran/generated/maxloc1_8_m4.c
index 6a086448f1cc..9bd8204a73c5 100644
--- a/libgfortran/generated/maxloc1_8_m4.c
+++ b/libgfortran/generated/maxloc1_8_m4.c
@@ -98,8 +98,7 @@ maxloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_m8.c b/libgfortran/generated/maxloc1_8_m8.c
index 497b18d2ba7b..c410839b99b8 100644
--- a/libgfortran/generated/maxloc1_8_m8.c
+++ b/libgfortran/generated/maxloc1_8_m8.c
@@ -98,8 +98,7 @@ maxloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index f67183f72383..3eb1024c6337 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -98,8 +98,7 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 6b2fc5989cd3..4535e954f610 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -98,8 +98,7 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_r17.c b/libgfortran/generated/maxloc1_8_r17.c
index 65b480827dfa..21ecb956b14f 100644
--- a/libgfortran/generated/maxloc1_8_r17.c
+++ b/libgfortran/generated/maxloc1_8_r17.c
@@ -98,8 +98,7 @@ maxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 844038c88e75..a1298a4775c5 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -98,8 +98,7 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index 7e61bfe83a58..8bbeda6e3160 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -98,8 +98,7 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -315,8 +314,7 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -517,8 +515,7 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c
index d4711e2e4742..7a0c2e03b82f 100644
--- a/libgfortran/generated/maxloc1_8_s1.c
+++ b/libgfortran/generated/maxloc1_8_s1.c
@@ -110,8 +110,7 @@ maxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c
index dea360e35adb..43c66a2ca78f 100644
--- a/libgfortran/generated/maxloc1_8_s4.c
+++ b/libgfortran/generated/maxloc1_8_s4.c
@@ -110,8 +110,7 @@ maxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mmaxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ smaxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval1_s1.c b/libgfortran/generated/maxval1_s1.c
index d866be7d6a0f..33a0f6cede4d 100644
--- a/libgfortran/generated/maxval1_s1.c
+++ b/libgfortran/generated/maxval1_s1.c
@@ -109,8 +109,7 @@ maxval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -303,8 +302,7 @@ mmaxval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]
@@ -475,8 +473,7 @@ smaxval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval1_s4.c b/libgfortran/generated/maxval1_s4.c
index 2c7a545fd817..37df4c0b5a64 100644
--- a/libgfortran/generated/maxval1_s4.c
+++ b/libgfortran/generated/maxval1_s4.c
@@ -109,8 +109,7 @@ maxval1_s4 (gfc_array_s4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -303,8 +302,7 @@ mmaxval1_s4 (gfc_array_s4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]
@@ -475,8 +473,7 @@ smaxval1_s4 (gfc_array_s4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index a7672ac9c84a..fbc2a7394a0f 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -95,8 +95,7 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index 1ab02452e17f..bce4dc5144c7 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -95,8 +95,7 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index 8aa05bb475a7..fc14a3399b6b 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -95,8 +95,7 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index a1493032022a..d172f4e6c1f8 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -95,8 +95,7 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index 42746ce53a73..2e9e5c16addd 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -95,8 +95,7 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_m1.c b/libgfortran/generated/maxval_m1.c
index 04bf5101c1b5..a1f18451a7ce 100644
--- a/libgfortran/generated/maxval_m1.c
+++ b/libgfortran/generated/maxval_m1.c
@@ -95,8 +95,7 @@ maxval_m1 (gfc_array_m1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_m1 (gfc_array_m1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_m1 (gfc_array_m1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_m16.c b/libgfortran/generated/maxval_m16.c
index 0833d0190544..15bac491fe30 100644
--- a/libgfortran/generated/maxval_m16.c
+++ b/libgfortran/generated/maxval_m16.c
@@ -95,8 +95,7 @@ maxval_m16 (gfc_array_m16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_m16 (gfc_array_m16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_m16 (gfc_array_m16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_m2.c b/libgfortran/generated/maxval_m2.c
index 70f3785d2c2c..87c9c9106e9b 100644
--- a/libgfortran/generated/maxval_m2.c
+++ b/libgfortran/generated/maxval_m2.c
@@ -95,8 +95,7 @@ maxval_m2 (gfc_array_m2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_m2 (gfc_array_m2 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_m2 (gfc_array_m2 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_m4.c b/libgfortran/generated/maxval_m4.c
index 3b1e79a480e6..f276d4555097 100644
--- a/libgfortran/generated/maxval_m4.c
+++ b/libgfortran/generated/maxval_m4.c
@@ -95,8 +95,7 @@ maxval_m4 (gfc_array_m4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_m4 (gfc_array_m4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_m4 (gfc_array_m4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_m8.c b/libgfortran/generated/maxval_m8.c
index ece64388c06f..0e85262a24d6 100644
--- a/libgfortran/generated/maxval_m8.c
+++ b/libgfortran/generated/maxval_m8.c
@@ -95,8 +95,7 @@ maxval_m8 (gfc_array_m8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_m8 (gfc_array_m8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_m8 (gfc_array_m8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index 7488db0c50a7..d240c0cbcc06 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -95,8 +95,7 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index c735944b4dfd..73c9a6433cce 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -95,8 +95,7 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_r17.c b/libgfortran/generated/maxval_r17.c
index 9e47d6506887..1ab8c1a0480f 100644
--- a/libgfortran/generated/maxval_r17.c
+++ b/libgfortran/generated/maxval_r17.c
@@ -95,8 +95,7 @@ maxval_r17 (gfc_array_r17 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_r17 (gfc_array_r17 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_r17 (gfc_array_r17 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index c379d2e43205..1d0bf7ed13b0 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -95,8 +95,7 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index 16e09bf3fb1f..223909ca04ac 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -95,8 +95,7 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -301,8 +300,7 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -488,8 +486,7 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc0_16_i1.c b/libgfortran/generated/minloc0_16_i1.c
index adc226f2d808..c98e1f254bbe 100644
--- a/libgfortran/generated/minloc0_16_i1.c
+++ b/libgfortran/generated/minloc0_16_i1.c
@@ -53,7 +53,7 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_i16.c b/libgfortran/generated/minloc0_16_i16.c
index 2202a1e8fa96..bb98641266ed 100644
--- a/libgfortran/generated/minloc0_16_i16.c
+++ b/libgfortran/generated/minloc0_16_i16.c
@@ -53,7 +53,7 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_i2.c b/libgfortran/generated/minloc0_16_i2.c
index 555d1ab7b25a..935c8368deb6 100644
--- a/libgfortran/generated/minloc0_16_i2.c
+++ b/libgfortran/generated/minloc0_16_i2.c
@@ -53,7 +53,7 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_i4.c b/libgfortran/generated/minloc0_16_i4.c
index 046c5959dd82..a9f62cba0e91 100644
--- a/libgfortran/generated/minloc0_16_i4.c
+++ b/libgfortran/generated/minloc0_16_i4.c
@@ -53,7 +53,7 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_i8.c b/libgfortran/generated/minloc0_16_i8.c
index f92fd5044967..e759380c9e77 100644
--- a/libgfortran/generated/minloc0_16_i8.c
+++ b/libgfortran/generated/minloc0_16_i8.c
@@ -53,7 +53,7 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_m1.c b/libgfortran/generated/minloc0_16_m1.c
index 22773727559b..ab9c39b77504 100644
--- a/libgfortran/generated/minloc0_16_m1.c
+++ b/libgfortran/generated/minloc0_16_m1.c
@@ -53,7 +53,7 @@ minloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_m1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_m16.c b/libgfortran/generated/minloc0_16_m16.c
index 98714e48b779..5c03f9672aaa 100644
--- a/libgfortran/generated/minloc0_16_m16.c
+++ b/libgfortran/generated/minloc0_16_m16.c
@@ -53,7 +53,7 @@ minloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_m16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_m2.c b/libgfortran/generated/minloc0_16_m2.c
index 43337a3a33fb..d1132ef2cefd 100644
--- a/libgfortran/generated/minloc0_16_m2.c
+++ b/libgfortran/generated/minloc0_16_m2.c
@@ -53,7 +53,7 @@ minloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_m2 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_m4.c b/libgfortran/generated/minloc0_16_m4.c
index 7752c7d8f9f6..c78a4c7409f0 100644
--- a/libgfortran/generated/minloc0_16_m4.c
+++ b/libgfortran/generated/minloc0_16_m4.c
@@ -53,7 +53,7 @@ minloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_m4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_m8.c b/libgfortran/generated/minloc0_16_m8.c
index fb32a4d74a8c..32c7acc02fe1 100644
--- a/libgfortran/generated/minloc0_16_m8.c
+++ b/libgfortran/generated/minloc0_16_m8.c
@@ -53,7 +53,7 @@ minloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_m8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_r10.c b/libgfortran/generated/minloc0_16_r10.c
index b8afb7d5da8c..3f2bda6c3189 100644
--- a/libgfortran/generated/minloc0_16_r10.c
+++ b/libgfortran/generated/minloc0_16_r10.c
@@ -53,7 +53,7 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_r16.c b/libgfortran/generated/minloc0_16_r16.c
index 000d687dfb8f..aa56b1679db1 100644
--- a/libgfortran/generated/minloc0_16_r16.c
+++ b/libgfortran/generated/minloc0_16_r16.c
@@ -53,7 +53,7 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_r17.c b/libgfortran/generated/minloc0_16_r17.c
index 25f8177c1e6c..21a44463c8a6 100644
--- a/libgfortran/generated/minloc0_16_r17.c
+++ b/libgfortran/generated/minloc0_16_r17.c
@@ -53,7 +53,7 @@ minloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_r17 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_r4.c b/libgfortran/generated/minloc0_16_r4.c
index 6b0970ec3608..a71b771d6ddc 100644
--- a/libgfortran/generated/minloc0_16_r4.c
+++ b/libgfortran/generated/minloc0_16_r4.c
@@ -53,7 +53,7 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_r8.c b/libgfortran/generated/minloc0_16_r8.c
index 5505e46e795c..b282fdeb6a00 100644
--- a/libgfortran/generated/minloc0_16_r8.c
+++ b/libgfortran/generated/minloc0_16_r8.c
@@ -53,7 +53,7 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -211,7 +211,7 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -388,7 +388,7 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_s1.c b/libgfortran/generated/minloc0_16_s1.c
index c3feabf56281..3b4ff8b914da 100644
--- a/libgfortran/generated/minloc0_16_s1.c
+++ b/libgfortran/generated/minloc0_16_s1.c
@@ -67,7 +67,7 @@ minloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -190,7 +190,7 @@ mminloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -331,7 +331,7 @@ sminloc0_16_s1 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_16_s4.c b/libgfortran/generated/minloc0_16_s4.c
index 326e6a71f153..e4ee627d6a35 100644
--- a/libgfortran/generated/minloc0_16_s4.c
+++ b/libgfortran/generated/minloc0_16_s4.c
@@ -67,7 +67,7 @@ minloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -190,7 +190,7 @@ mminloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
@@ -331,7 +331,7 @@ sminloc0_16_s4 (gfc_array_i16 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
diff --git a/libgfortran/generated/minloc0_4_i1.c b/libgfortran/generated/minloc0_4_i1.c
index b031308e7b3f..b82fafe4efe9 100644
--- a/libgfortran/generated/minloc0_4_i1.c
+++ b/libgfortran/generated/minloc0_4_i1.c
@@ -53,7 +53,7 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_i16.c b/libgfortran/generated/minloc0_4_i16.c
index 6f843bc69057..1aa09fade56b 100644
--- a/libgfortran/generated/minloc0_4_i16.c
+++ b/libgfortran/generated/minloc0_4_i16.c
@@ -53,7 +53,7 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_i2.c b/libgfortran/generated/minloc0_4_i2.c
index 5008a15643fa..14c059d3e349 100644
--- a/libgfortran/generated/minloc0_4_i2.c
+++ b/libgfortran/generated/minloc0_4_i2.c
@@ -53,7 +53,7 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c
index eba892dbbb2a..ebc8d9ab284a 100644
--- a/libgfortran/generated/minloc0_4_i4.c
+++ b/libgfortran/generated/minloc0_4_i4.c
@@ -53,7 +53,7 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c
index b78bd240b2b4..5156bbdefa04 100644
--- a/libgfortran/generated/minloc0_4_i8.c
+++ b/libgfortran/generated/minloc0_4_i8.c
@@ -53,7 +53,7 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_m1.c b/libgfortran/generated/minloc0_4_m1.c
index 311b727a045b..144ccc5df3cb 100644
--- a/libgfortran/generated/minloc0_4_m1.c
+++ b/libgfortran/generated/minloc0_4_m1.c
@@ -53,7 +53,7 @@ minloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_m1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_m16.c b/libgfortran/generated/minloc0_4_m16.c
index 988388cfbef2..c481cd68e0ec 100644
--- a/libgfortran/generated/minloc0_4_m16.c
+++ b/libgfortran/generated/minloc0_4_m16.c
@@ -53,7 +53,7 @@ minloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_m16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_m2.c b/libgfortran/generated/minloc0_4_m2.c
index 12391266fe19..c94ee722b93a 100644
--- a/libgfortran/generated/minloc0_4_m2.c
+++ b/libgfortran/generated/minloc0_4_m2.c
@@ -53,7 +53,7 @@ minloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_m2 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_m4.c b/libgfortran/generated/minloc0_4_m4.c
index bab0048d5f05..d3b00c0084cb 100644
--- a/libgfortran/generated/minloc0_4_m4.c
+++ b/libgfortran/generated/minloc0_4_m4.c
@@ -53,7 +53,7 @@ minloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_m4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_m8.c b/libgfortran/generated/minloc0_4_m8.c
index bd461ece30b8..676cbcbba3cb 100644
--- a/libgfortran/generated/minloc0_4_m8.c
+++ b/libgfortran/generated/minloc0_4_m8.c
@@ -53,7 +53,7 @@ minloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_m8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_r10.c b/libgfortran/generated/minloc0_4_r10.c
index 2b42ac17ef34..ae9b8dda31a3 100644
--- a/libgfortran/generated/minloc0_4_r10.c
+++ b/libgfortran/generated/minloc0_4_r10.c
@@ -53,7 +53,7 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_r16.c b/libgfortran/generated/minloc0_4_r16.c
index 630ab527a727..160d883d034d 100644
--- a/libgfortran/generated/minloc0_4_r16.c
+++ b/libgfortran/generated/minloc0_4_r16.c
@@ -53,7 +53,7 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_r17.c b/libgfortran/generated/minloc0_4_r17.c
index f86f9f3863c2..0ca8bdce6c34 100644
--- a/libgfortran/generated/minloc0_4_r17.c
+++ b/libgfortran/generated/minloc0_4_r17.c
@@ -53,7 +53,7 @@ minloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_r17 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c
index 9b15aa6d825f..ece2261e7ad1 100644
--- a/libgfortran/generated/minloc0_4_r4.c
+++ b/libgfortran/generated/minloc0_4_r4.c
@@ -53,7 +53,7 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c
index 97d7f09bf865..b0f76f22972c 100644
--- a/libgfortran/generated/minloc0_4_r8.c
+++ b/libgfortran/generated/minloc0_4_r8.c
@@ -53,7 +53,7 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -211,7 +211,7 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -388,7 +388,7 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_s1.c b/libgfortran/generated/minloc0_4_s1.c
index c08bb5b1375c..2c1d9b14ab67 100644
--- a/libgfortran/generated/minloc0_4_s1.c
+++ b/libgfortran/generated/minloc0_4_s1.c
@@ -67,7 +67,7 @@ minloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -190,7 +190,7 @@ mminloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -331,7 +331,7 @@ sminloc0_4_s1 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_4_s4.c b/libgfortran/generated/minloc0_4_s4.c
index c353d94eb9b0..b966f401666e 100644
--- a/libgfortran/generated/minloc0_4_s4.c
+++ b/libgfortran/generated/minloc0_4_s4.c
@@ -67,7 +67,7 @@ minloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -190,7 +190,7 @@ mminloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
@@ -331,7 +331,7 @@ sminloc0_4_s4 (gfc_array_i4 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
diff --git a/libgfortran/generated/minloc0_8_i1.c b/libgfortran/generated/minloc0_8_i1.c
index 4f3090f9939e..733ac618af39 100644
--- a/libgfortran/generated/minloc0_8_i1.c
+++ b/libgfortran/generated/minloc0_8_i1.c
@@ -53,7 +53,7 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_i16.c b/libgfortran/generated/minloc0_8_i16.c
index 6e7ea6b43fed..f04bebfaa153 100644
--- a/libgfortran/generated/minloc0_8_i16.c
+++ b/libgfortran/generated/minloc0_8_i16.c
@@ -53,7 +53,7 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_i2.c b/libgfortran/generated/minloc0_8_i2.c
index ff282efd0fc7..599f1d873396 100644
--- a/libgfortran/generated/minloc0_8_i2.c
+++ b/libgfortran/generated/minloc0_8_i2.c
@@ -53,7 +53,7 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c
index cae428e73cef..33d1d2b77755 100644
--- a/libgfortran/generated/minloc0_8_i4.c
+++ b/libgfortran/generated/minloc0_8_i4.c
@@ -53,7 +53,7 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c
index e474f0a13ad3..f6a8ac338115 100644
--- a/libgfortran/generated/minloc0_8_i8.c
+++ b/libgfortran/generated/minloc0_8_i8.c
@@ -53,7 +53,7 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_m1.c b/libgfortran/generated/minloc0_8_m1.c
index 7f3c3073a1f0..9831d43f41df 100644
--- a/libgfortran/generated/minloc0_8_m1.c
+++ b/libgfortran/generated/minloc0_8_m1.c
@@ -53,7 +53,7 @@ minloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_m1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_m16.c b/libgfortran/generated/minloc0_8_m16.c
index c0635ee8e9e3..9260815d6ad2 100644
--- a/libgfortran/generated/minloc0_8_m16.c
+++ b/libgfortran/generated/minloc0_8_m16.c
@@ -53,7 +53,7 @@ minloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_m16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_m2.c b/libgfortran/generated/minloc0_8_m2.c
index 7321b0ff2963..141f702e17a2 100644
--- a/libgfortran/generated/minloc0_8_m2.c
+++ b/libgfortran/generated/minloc0_8_m2.c
@@ -53,7 +53,7 @@ minloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_m2 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_m4.c b/libgfortran/generated/minloc0_8_m4.c
index df185a565848..ce4811ab9d66 100644
--- a/libgfortran/generated/minloc0_8_m4.c
+++ b/libgfortran/generated/minloc0_8_m4.c
@@ -53,7 +53,7 @@ minloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_m4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_m8.c b/libgfortran/generated/minloc0_8_m8.c
index 1cc07ff5fe51..699485f28f8a 100644
--- a/libgfortran/generated/minloc0_8_m8.c
+++ b/libgfortran/generated/minloc0_8_m8.c
@@ -53,7 +53,7 @@ minloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_m8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_r10.c b/libgfortran/generated/minloc0_8_r10.c
index 646727ffc800..3475943ca408 100644
--- a/libgfortran/generated/minloc0_8_r10.c
+++ b/libgfortran/generated/minloc0_8_r10.c
@@ -53,7 +53,7 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_r16.c b/libgfortran/generated/minloc0_8_r16.c
index 9e1e0ff69477..ec904fe9f611 100644
--- a/libgfortran/generated/minloc0_8_r16.c
+++ b/libgfortran/generated/minloc0_8_r16.c
@@ -53,7 +53,7 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_r17.c b/libgfortran/generated/minloc0_8_r17.c
index fc4a4e79ac40..bea85243e1cc 100644
--- a/libgfortran/generated/minloc0_8_r17.c
+++ b/libgfortran/generated/minloc0_8_r17.c
@@ -53,7 +53,7 @@ minloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_r17 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c
index 29096f435210..bce2235193d4 100644
--- a/libgfortran/generated/minloc0_8_r4.c
+++ b/libgfortran/generated/minloc0_8_r4.c
@@ -53,7 +53,7 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c
index 142ffc87ae61..81e7d50055da 100644
--- a/libgfortran/generated/minloc0_8_r8.c
+++ b/libgfortran/generated/minloc0_8_r8.c
@@ -53,7 +53,7 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -211,7 +211,7 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -388,7 +388,7 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_s1.c b/libgfortran/generated/minloc0_8_s1.c
index 42243196dc2c..735120829e14 100644
--- a/libgfortran/generated/minloc0_8_s1.c
+++ b/libgfortran/generated/minloc0_8_s1.c
@@ -67,7 +67,7 @@ minloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -190,7 +190,7 @@ mminloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -331,7 +331,7 @@ sminloc0_8_s1 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc0_8_s4.c b/libgfortran/generated/minloc0_8_s4.c
index 2fa6a85d409a..ec0ea6d23713 100644
--- a/libgfortran/generated/minloc0_8_s4.c
+++ b/libgfortran/generated/minloc0_8_s4.c
@@ -67,7 +67,7 @@ minloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -190,7 +190,7 @@ mminloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank - 1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank - 1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
@@ -331,7 +331,7 @@ sminloc0_8_s4 (gfc_array_i8 * const restrict retarray,
 
   if (retarray->base_addr == NULL)
     {
-      GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
+      GFC_DESCRIPTOR_DIMENSION_SET(retarray, 0, 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
       retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_8));
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index 840139f18dad..53754fa7e73c 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -98,8 +98,7 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index 4b6545fd012f..1b8474f58ac7 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -98,8 +98,7 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 89f9465b2b1a..51dc326990b6 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -98,8 +98,7 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 4475dfe78e66..f8049d30d82b 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -98,8 +98,7 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index 394789861ba5..7d30d745b62c 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -98,8 +98,7 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_m1.c b/libgfortran/generated/minloc1_16_m1.c
index e612abbdd077..f45bbb834169 100644
--- a/libgfortran/generated/minloc1_16_m1.c
+++ b/libgfortran/generated/minloc1_16_m1.c
@@ -98,8 +98,7 @@ minloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_m1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_m16.c b/libgfortran/generated/minloc1_16_m16.c
index 42aed6f21c04..09641c1258b9 100644
--- a/libgfortran/generated/minloc1_16_m16.c
+++ b/libgfortran/generated/minloc1_16_m16.c
@@ -98,8 +98,7 @@ minloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_m16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_m2.c b/libgfortran/generated/minloc1_16_m2.c
index fff817bcba26..47f6598b4ec1 100644
--- a/libgfortran/generated/minloc1_16_m2.c
+++ b/libgfortran/generated/minloc1_16_m2.c
@@ -98,8 +98,7 @@ minloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_m2 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_m4.c b/libgfortran/generated/minloc1_16_m4.c
index 08c70ac25050..0fe7a5c0852e 100644
--- a/libgfortran/generated/minloc1_16_m4.c
+++ b/libgfortran/generated/minloc1_16_m4.c
@@ -98,8 +98,7 @@ minloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_m4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_m8.c b/libgfortran/generated/minloc1_16_m8.c
index c8121d6f97c9..4cc5d8b6beee 100644
--- a/libgfortran/generated/minloc1_16_m8.c
+++ b/libgfortran/generated/minloc1_16_m8.c
@@ -98,8 +98,7 @@ minloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_m8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index 46fc94e801ff..db3b03fb0557 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -98,8 +98,7 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index da3b8f2b7b9e..6d7baade1f47 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -98,8 +98,7 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_r17.c b/libgfortran/generated/minloc1_16_r17.c
index 8777ecfef3d0..5b1aeadf610d 100644
--- a/libgfortran/generated/minloc1_16_r17.c
+++ b/libgfortran/generated/minloc1_16_r17.c
@@ -98,8 +98,7 @@ minloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index 1c550175242f..aa1803af9fd7 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -98,8 +98,7 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index e778c4709328..026909654ea9 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -98,8 +98,7 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c
index b654608a8d94..49a132fb7af5 100644
--- a/libgfortran/generated/minloc1_16_s1.c
+++ b/libgfortran/generated/minloc1_16_s1.c
@@ -110,8 +110,7 @@ minloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c
index 2e709a7c105d..1190d7858fd8 100644
--- a/libgfortran/generated/minloc1_16_s4.c
+++ b/libgfortran/generated/minloc1_16_s4.c
@@ -110,8 +110,7 @@ minloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 639838bc5e9a..e83091a2c442 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -98,8 +98,7 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index b86e3cc06461..ab13d86291cd 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -98,8 +98,7 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index 8def21c8addb..6af2662e0035 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -98,8 +98,7 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index e42b9f8181b9..c18cee9c9bd1 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -98,8 +98,7 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index cc9fa4cc78d0..bb0897f85364 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -98,8 +98,7 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_m1.c b/libgfortran/generated/minloc1_4_m1.c
index df28f4969308..18e22aa869ff 100644
--- a/libgfortran/generated/minloc1_4_m1.c
+++ b/libgfortran/generated/minloc1_4_m1.c
@@ -98,8 +98,7 @@ minloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_m1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_m16.c b/libgfortran/generated/minloc1_4_m16.c
index 4c7dcebbc267..13f283399a95 100644
--- a/libgfortran/generated/minloc1_4_m16.c
+++ b/libgfortran/generated/minloc1_4_m16.c
@@ -98,8 +98,7 @@ minloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_m16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_m2.c b/libgfortran/generated/minloc1_4_m2.c
index 977276522cd2..ccdc26432359 100644
--- a/libgfortran/generated/minloc1_4_m2.c
+++ b/libgfortran/generated/minloc1_4_m2.c
@@ -98,8 +98,7 @@ minloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_m2 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_m4.c b/libgfortran/generated/minloc1_4_m4.c
index 74ed86d6b94a..69c69220fc98 100644
--- a/libgfortran/generated/minloc1_4_m4.c
+++ b/libgfortran/generated/minloc1_4_m4.c
@@ -98,8 +98,7 @@ minloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_m4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_m8.c b/libgfortran/generated/minloc1_4_m8.c
index d2b049017a02..f46acdf3926c 100644
--- a/libgfortran/generated/minloc1_4_m8.c
+++ b/libgfortran/generated/minloc1_4_m8.c
@@ -98,8 +98,7 @@ minloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_m8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 65ce7b9c3f7a..56660aa11bca 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -98,8 +98,7 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index ddd21c95d76a..03f98a65314e 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -98,8 +98,7 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_r17.c b/libgfortran/generated/minloc1_4_r17.c
index 0b90a10624e8..d5928a84bc9e 100644
--- a/libgfortran/generated/minloc1_4_r17.c
+++ b/libgfortran/generated/minloc1_4_r17.c
@@ -98,8 +98,7 @@ minloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index 0a68f2c1cd27..bb5da76a0a28 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -98,8 +98,7 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index b89deb521ea3..76c6e8a65c49 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -98,8 +98,7 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c
index 61dad5530ee1..80476f7c3688 100644
--- a/libgfortran/generated/minloc1_4_s1.c
+++ b/libgfortran/generated/minloc1_4_s1.c
@@ -110,8 +110,7 @@ minloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c
index 49c25d06363b..e92fde83cbde 100644
--- a/libgfortran/generated/minloc1_4_s4.c
+++ b/libgfortran/generated/minloc1_4_s4.c
@@ -110,8 +110,7 @@ minloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index f4fa5a091f43..66293dc84199 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -98,8 +98,7 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 73edefbf21a9..183fc91334b7 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -98,8 +98,7 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index 126587caf771..d9176e68cd63 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -98,8 +98,7 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index eafbbe10dcc0..6d70e90ad103 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -98,8 +98,7 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index c806250d7a5b..99c01fdbd12f 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -98,8 +98,7 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_m1.c b/libgfortran/generated/minloc1_8_m1.c
index 19d9867637dd..8cbd930e060e 100644
--- a/libgfortran/generated/minloc1_8_m1.c
+++ b/libgfortran/generated/minloc1_8_m1.c
@@ -98,8 +98,7 @@ minloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_m1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_m16.c b/libgfortran/generated/minloc1_8_m16.c
index 3651b09d9de5..9eeeea4fa12e 100644
--- a/libgfortran/generated/minloc1_8_m16.c
+++ b/libgfortran/generated/minloc1_8_m16.c
@@ -98,8 +98,7 @@ minloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_m16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_m2.c b/libgfortran/generated/minloc1_8_m2.c
index 760e717783cc..8b3b31f105cb 100644
--- a/libgfortran/generated/minloc1_8_m2.c
+++ b/libgfortran/generated/minloc1_8_m2.c
@@ -98,8 +98,7 @@ minloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_m2 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_m4.c b/libgfortran/generated/minloc1_8_m4.c
index 187f67e59576..236eacd6b550 100644
--- a/libgfortran/generated/minloc1_8_m4.c
+++ b/libgfortran/generated/minloc1_8_m4.c
@@ -98,8 +98,7 @@ minloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_m4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_m8.c b/libgfortran/generated/minloc1_8_m8.c
index 69b17b9cc713..496b38dc0ddd 100644
--- a/libgfortran/generated/minloc1_8_m8.c
+++ b/libgfortran/generated/minloc1_8_m8.c
@@ -98,8 +98,7 @@ minloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_m8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index 5e87310fb017..0924b9a8af86 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -98,8 +98,7 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index a0df1baf7295..649cbe492e14 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -98,8 +98,7 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_r17.c b/libgfortran/generated/minloc1_8_r17.c
index 023ecd39a9a3..5b39bb01bfb1 100644
--- a/libgfortran/generated/minloc1_8_r17.c
+++ b/libgfortran/generated/minloc1_8_r17.c
@@ -98,8 +98,7 @@ minloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index b0d5d151c784..6a5facabe246 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -98,8 +98,7 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index 2b12a8ae8d55..e8894edb69db 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -98,8 +98,7 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -325,8 +324,7 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -527,8 +525,7 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c
index c0ac6e6ba7a4..b0c971b86145 100644
--- a/libgfortran/generated/minloc1_8_s1.c
+++ b/libgfortran/generated/minloc1_8_s1.c
@@ -110,8 +110,7 @@ minloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c
index 29624d0f41f0..425c5f639efa 100644
--- a/libgfortran/generated/minloc1_8_s4.c
+++ b/libgfortran/generated/minloc1_8_s4.c
@@ -110,8 +110,7 @@ minloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -308,8 +307,7 @@ mminloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
@@ -482,8 +480,7 @@ sminloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minval1_s1.c b/libgfortran/generated/minval1_s1.c
index 431e90c882dd..6f096dadc33c 100644
--- a/libgfortran/generated/minval1_s1.c
+++ b/libgfortran/generated/minval1_s1.c
@@ -109,8 +109,7 @@ minval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -303,8 +302,7 @@ mminval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1]
@@ -475,8 +473,7 @@ sminval1_s1 (gfc_array_s1 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
diff --git a/libgfortran/generated/minval1_s4.c b/libgfortran/generated/minval1_s4.c
index 7f012156cf65..ece0bdd364d1 100644
--- a/libgfortran/generated/minval1_s4.c
+++ b/libgfortran/generated/minval1_s4.c
@@ -109,8 +109,7 @@ minval1_s4 (gfc_array_s4 * const restrict retarray,
 	  else
 	    str = GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 
-	  GFC_DIMENSION_SET(retarray->dim[n], 0, extent[n] - 1, str);
-
+	  GFC_DESCRIPTOR_DIMENSION_SET(retarray, n, 0, extent[n] - 1, str);
 	}
 
       retarray->offset = 0;
@@ -303,8 +302,7 @@ mminval1_s4 (gfc_array_s4 * const restrict retarray,
 	  else
 	    str= GFC_DESCRIPTOR_STRIDE(retarray,n-1) * extent[n-1];
 [...]

[diff truncated at 524288 bytes]


More information about the Gcc-cvs mailing list