[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Régénération fichiers générés
Mikael Morin
mikael@gcc.gnu.org
Fri Sep 12 18:01:39 GMT 2025
https://gcc.gnu.org/g:81e99d962aa42844a390b3d1590b4d76e9b063db
commit 81e99d962aa42844a390b3d1590b4d76e9b063db
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Mon Sep 8 21:54:10 2025 +0200
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Régénération des fichiers générés
Régénération fichiers générés
Régénération fichiers générés
Diff:
---
libgfortran/generated/all_l1.c | 17 +++---
libgfortran/generated/all_l16.c | 17 +++---
libgfortran/generated/all_l2.c | 17 +++---
libgfortran/generated/all_l4.c | 17 +++---
libgfortran/generated/all_l8.c | 17 +++---
libgfortran/generated/any_l1.c | 17 +++---
libgfortran/generated/any_l16.c | 17 +++---
libgfortran/generated/any_l2.c | 17 +++---
libgfortran/generated/any_l4.c | 17 +++---
libgfortran/generated/any_l8.c | 17 +++---
libgfortran/generated/count_16_l.c | 17 +++---
libgfortran/generated/count_1_l.c | 17 +++---
libgfortran/generated/count_2_l.c | 17 +++---
libgfortran/generated/count_4_l.c | 17 +++---
libgfortran/generated/count_8_l.c | 17 +++---
libgfortran/generated/cshift0_c10.c | 52 +++++++++---------
libgfortran/generated/cshift0_c16.c | 52 +++++++++---------
libgfortran/generated/cshift0_c17.c | 52 +++++++++---------
libgfortran/generated/cshift0_c4.c | 52 +++++++++---------
libgfortran/generated/cshift0_c8.c | 52 +++++++++---------
libgfortran/generated/cshift0_i1.c | 52 +++++++++---------
libgfortran/generated/cshift0_i16.c | 52 +++++++++---------
libgfortran/generated/cshift0_i2.c | 52 +++++++++---------
libgfortran/generated/cshift0_i4.c | 52 +++++++++---------
libgfortran/generated/cshift0_i8.c | 52 +++++++++---------
libgfortran/generated/cshift0_r10.c | 52 +++++++++---------
libgfortran/generated/cshift0_r16.c | 52 +++++++++---------
libgfortran/generated/cshift0_r17.c | 52 +++++++++---------
libgfortran/generated/cshift0_r4.c | 52 +++++++++---------
libgfortran/generated/cshift0_r8.c | 52 +++++++++---------
libgfortran/generated/cshift1_16.c | 10 ++--
libgfortran/generated/cshift1_16_c10.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_c16.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_c17.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_c4.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_c8.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_i1.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_i16.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_i2.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_i4.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_i8.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_r10.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_r16.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_r17.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_r4.c | 50 ++++++++---------
libgfortran/generated/cshift1_16_r8.c | 50 ++++++++---------
libgfortran/generated/cshift1_4.c | 10 ++--
libgfortran/generated/cshift1_4_c10.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_c16.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_c17.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_c4.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_c8.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_i1.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_i16.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_i2.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_i4.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_i8.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_r10.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_r16.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_r17.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_r4.c | 50 ++++++++---------
libgfortran/generated/cshift1_4_r8.c | 50 ++++++++---------
libgfortran/generated/cshift1_8.c | 10 ++--
libgfortran/generated/cshift1_8_c10.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_c16.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_c17.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_c4.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_c8.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_i1.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_i16.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_i2.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_i4.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_i8.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_r10.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_r16.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_r17.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_r4.c | 50 ++++++++---------
libgfortran/generated/cshift1_8_r8.c | 50 ++++++++---------
libgfortran/generated/eoshift1_16.c | 10 ++--
libgfortran/generated/eoshift1_4.c | 10 ++--
libgfortran/generated/eoshift1_8.c | 10 ++--
libgfortran/generated/eoshift3_16.c | 10 ++--
libgfortran/generated/eoshift3_4.c | 10 ++--
libgfortran/generated/eoshift3_8.c | 10 ++--
libgfortran/generated/findloc0_c10.c | 28 +++++-----
libgfortran/generated/findloc0_c16.c | 28 +++++-----
libgfortran/generated/findloc0_c17.c | 28 +++++-----
libgfortran/generated/findloc0_c4.c | 28 +++++-----
libgfortran/generated/findloc0_c8.c | 28 +++++-----
libgfortran/generated/findloc0_i1.c | 28 +++++-----
libgfortran/generated/findloc0_i16.c | 28 +++++-----
libgfortran/generated/findloc0_i2.c | 28 +++++-----
libgfortran/generated/findloc0_i4.c | 28 +++++-----
libgfortran/generated/findloc0_i8.c | 28 +++++-----
libgfortran/generated/findloc0_r10.c | 28 +++++-----
libgfortran/generated/findloc0_r16.c | 28 +++++-----
libgfortran/generated/findloc0_r17.c | 28 +++++-----
libgfortran/generated/findloc0_r4.c | 28 +++++-----
libgfortran/generated/findloc0_r8.c | 28 +++++-----
libgfortran/generated/findloc0_s1.c | 28 +++++-----
libgfortran/generated/findloc0_s4.c | 28 +++++-----
libgfortran/generated/findloc1_c10.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_c16.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_c17.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_c4.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_c8.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_i1.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_i16.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_i2.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_i4.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_i8.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_r10.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_r16.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_r17.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_r4.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_r8.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_s1.c | 66 ++++++++++++-----------
libgfortran/generated/findloc1_s4.c | 66 ++++++++++++-----------
libgfortran/generated/findloc2_s1.c | 14 ++---
libgfortran/generated/findloc2_s4.c | 14 ++---
libgfortran/generated/iall_i1.c | 59 +++++++++++---------
libgfortran/generated/iall_i16.c | 59 +++++++++++---------
libgfortran/generated/iall_i2.c | 59 +++++++++++---------
libgfortran/generated/iall_i4.c | 59 +++++++++++---------
libgfortran/generated/iall_i8.c | 59 +++++++++++---------
libgfortran/generated/iany_i1.c | 59 +++++++++++---------
libgfortran/generated/iany_i16.c | 59 +++++++++++---------
libgfortran/generated/iany_i2.c | 59 +++++++++++---------
libgfortran/generated/iany_i4.c | 59 +++++++++++---------
libgfortran/generated/iany_i8.c | 59 +++++++++++---------
libgfortran/generated/in_pack_c10.c | 10 ++--
libgfortran/generated/in_pack_c16.c | 10 ++--
libgfortran/generated/in_pack_c17.c | 10 ++--
libgfortran/generated/in_pack_c4.c | 10 ++--
libgfortran/generated/in_pack_c8.c | 10 ++--
libgfortran/generated/in_pack_i1.c | 10 ++--
libgfortran/generated/in_pack_i16.c | 10 ++--
libgfortran/generated/in_pack_i2.c | 10 ++--
libgfortran/generated/in_pack_i4.c | 10 ++--
libgfortran/generated/in_pack_i8.c | 10 ++--
libgfortran/generated/in_pack_r10.c | 10 ++--
libgfortran/generated/in_pack_r16.c | 10 ++--
libgfortran/generated/in_pack_r17.c | 10 ++--
libgfortran/generated/in_pack_r4.c | 10 ++--
libgfortran/generated/in_pack_r8.c | 10 ++--
libgfortran/generated/in_unpack_c10.c | 12 ++---
libgfortran/generated/in_unpack_c16.c | 12 ++---
libgfortran/generated/in_unpack_c17.c | 12 ++---
libgfortran/generated/in_unpack_c4.c | 12 ++---
libgfortran/generated/in_unpack_c8.c | 12 ++---
libgfortran/generated/in_unpack_i1.c | 12 ++---
libgfortran/generated/in_unpack_i16.c | 12 ++---
libgfortran/generated/in_unpack_i2.c | 12 ++---
libgfortran/generated/in_unpack_i4.c | 12 ++---
libgfortran/generated/in_unpack_i8.c | 12 ++---
libgfortran/generated/in_unpack_r10.c | 12 ++---
libgfortran/generated/in_unpack_r16.c | 12 ++---
libgfortran/generated/in_unpack_r17.c | 12 ++---
libgfortran/generated/in_unpack_r4.c | 12 ++---
libgfortran/generated/in_unpack_r8.c | 12 ++---
libgfortran/generated/iparity_i1.c | 59 +++++++++++---------
libgfortran/generated/iparity_i16.c | 59 +++++++++++---------
libgfortran/generated/iparity_i2.c | 59 +++++++++++---------
libgfortran/generated/iparity_i4.c | 59 +++++++++++---------
libgfortran/generated/iparity_i8.c | 59 +++++++++++---------
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 | 4 +-
libgfortran/generated/matmul_l4.c | 4 +-
libgfortran/generated/matmul_l8.c | 4 +-
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 | 24 ++++-----
libgfortran/generated/maxloc0_16_i16.c | 24 ++++-----
libgfortran/generated/maxloc0_16_i2.c | 24 ++++-----
libgfortran/generated/maxloc0_16_i4.c | 24 ++++-----
libgfortran/generated/maxloc0_16_i8.c | 24 ++++-----
libgfortran/generated/maxloc0_16_m1.c | 24 ++++-----
libgfortran/generated/maxloc0_16_m16.c | 24 ++++-----
libgfortran/generated/maxloc0_16_m2.c | 24 ++++-----
libgfortran/generated/maxloc0_16_m4.c | 24 ++++-----
libgfortran/generated/maxloc0_16_m8.c | 24 ++++-----
libgfortran/generated/maxloc0_16_r10.c | 24 ++++-----
libgfortran/generated/maxloc0_16_r16.c | 24 ++++-----
libgfortran/generated/maxloc0_16_r17.c | 24 ++++-----
libgfortran/generated/maxloc0_16_r4.c | 24 ++++-----
libgfortran/generated/maxloc0_16_r8.c | 24 ++++-----
libgfortran/generated/maxloc0_16_s1.c | 16 +++---
libgfortran/generated/maxloc0_16_s4.c | 16 +++---
libgfortran/generated/maxloc0_4_i1.c | 24 ++++-----
libgfortran/generated/maxloc0_4_i16.c | 24 ++++-----
libgfortran/generated/maxloc0_4_i2.c | 24 ++++-----
libgfortran/generated/maxloc0_4_i4.c | 24 ++++-----
libgfortran/generated/maxloc0_4_i8.c | 24 ++++-----
libgfortran/generated/maxloc0_4_m1.c | 24 ++++-----
libgfortran/generated/maxloc0_4_m16.c | 24 ++++-----
libgfortran/generated/maxloc0_4_m2.c | 24 ++++-----
libgfortran/generated/maxloc0_4_m4.c | 24 ++++-----
libgfortran/generated/maxloc0_4_m8.c | 24 ++++-----
libgfortran/generated/maxloc0_4_r10.c | 24 ++++-----
libgfortran/generated/maxloc0_4_r16.c | 24 ++++-----
libgfortran/generated/maxloc0_4_r17.c | 24 ++++-----
libgfortran/generated/maxloc0_4_r4.c | 24 ++++-----
libgfortran/generated/maxloc0_4_r8.c | 24 ++++-----
libgfortran/generated/maxloc0_4_s1.c | 16 +++---
libgfortran/generated/maxloc0_4_s4.c | 16 +++---
libgfortran/generated/maxloc0_8_i1.c | 24 ++++-----
libgfortran/generated/maxloc0_8_i16.c | 24 ++++-----
libgfortran/generated/maxloc0_8_i2.c | 24 ++++-----
libgfortran/generated/maxloc0_8_i4.c | 24 ++++-----
libgfortran/generated/maxloc0_8_i8.c | 24 ++++-----
libgfortran/generated/maxloc0_8_m1.c | 24 ++++-----
libgfortran/generated/maxloc0_8_m16.c | 24 ++++-----
libgfortran/generated/maxloc0_8_m2.c | 24 ++++-----
libgfortran/generated/maxloc0_8_m4.c | 24 ++++-----
libgfortran/generated/maxloc0_8_m8.c | 24 ++++-----
libgfortran/generated/maxloc0_8_r10.c | 24 ++++-----
libgfortran/generated/maxloc0_8_r16.c | 24 ++++-----
libgfortran/generated/maxloc0_8_r17.c | 24 ++++-----
libgfortran/generated/maxloc0_8_r4.c | 24 ++++-----
libgfortran/generated/maxloc0_8_r8.c | 24 ++++-----
libgfortran/generated/maxloc0_8_s1.c | 16 +++---
libgfortran/generated/maxloc0_8_s4.c | 16 +++---
libgfortran/generated/maxloc1_16_i1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_i16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_i2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_i4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_i8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_m1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_m16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_m2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_m4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_m8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_r10.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_r16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_r17.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_r4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_r8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_16_s1.c | 59 ++++++++++----------
libgfortran/generated/maxloc1_16_s4.c | 59 ++++++++++----------
libgfortran/generated/maxloc1_4_i1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_i16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_i2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_i4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_i8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_m1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_m16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_m2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_m4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_m8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_r10.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_r16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_r17.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_r4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_r8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_4_s1.c | 59 ++++++++++----------
libgfortran/generated/maxloc1_4_s4.c | 59 ++++++++++----------
libgfortran/generated/maxloc1_8_i1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_i16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_i2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_i4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_i8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_m1.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_m16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_m2.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_m4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_m8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_r10.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_r16.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_r17.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_r4.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_r8.c | 88 +++++++++++++++++-------------
libgfortran/generated/maxloc1_8_s1.c | 59 ++++++++++----------
libgfortran/generated/maxloc1_8_s4.c | 59 ++++++++++----------
libgfortran/generated/maxloc2_16_s1.c | 10 ++--
libgfortran/generated/maxloc2_16_s4.c | 10 ++--
libgfortran/generated/maxloc2_4_s1.c | 10 ++--
libgfortran/generated/maxloc2_4_s4.c | 10 ++--
libgfortran/generated/maxloc2_8_s1.c | 10 ++--
libgfortran/generated/maxloc2_8_s4.c | 10 ++--
libgfortran/generated/maxval0_s1.c | 16 +++---
libgfortran/generated/maxval0_s4.c | 16 +++---
libgfortran/generated/maxval1_s1.c | 59 ++++++++++----------
libgfortran/generated/maxval1_s4.c | 59 ++++++++++----------
libgfortran/generated/maxval_i1.c | 66 +++++++++++++----------
libgfortran/generated/maxval_i16.c | 66 +++++++++++++----------
libgfortran/generated/maxval_i2.c | 66 +++++++++++++----------
libgfortran/generated/maxval_i4.c | 66 +++++++++++++----------
libgfortran/generated/maxval_i8.c | 66 +++++++++++++----------
libgfortran/generated/maxval_m1.c | 66 +++++++++++++----------
libgfortran/generated/maxval_m16.c | 66 +++++++++++++----------
libgfortran/generated/maxval_m2.c | 66 +++++++++++++----------
libgfortran/generated/maxval_m4.c | 66 +++++++++++++----------
libgfortran/generated/maxval_m8.c | 66 +++++++++++++----------
libgfortran/generated/maxval_r10.c | 66 +++++++++++++----------
libgfortran/generated/maxval_r16.c | 66 +++++++++++++----------
libgfortran/generated/maxval_r17.c | 66 +++++++++++++----------
libgfortran/generated/maxval_r4.c | 66 +++++++++++++----------
libgfortran/generated/maxval_r8.c | 66 +++++++++++++----------
libgfortran/generated/minloc0_16_i1.c | 24 ++++-----
libgfortran/generated/minloc0_16_i16.c | 24 ++++-----
libgfortran/generated/minloc0_16_i2.c | 24 ++++-----
libgfortran/generated/minloc0_16_i4.c | 24 ++++-----
libgfortran/generated/minloc0_16_i8.c | 24 ++++-----
libgfortran/generated/minloc0_16_m1.c | 24 ++++-----
libgfortran/generated/minloc0_16_m16.c | 24 ++++-----
libgfortran/generated/minloc0_16_m2.c | 24 ++++-----
libgfortran/generated/minloc0_16_m4.c | 24 ++++-----
libgfortran/generated/minloc0_16_m8.c | 24 ++++-----
libgfortran/generated/minloc0_16_r10.c | 24 ++++-----
libgfortran/generated/minloc0_16_r16.c | 24 ++++-----
libgfortran/generated/minloc0_16_r17.c | 24 ++++-----
libgfortran/generated/minloc0_16_r4.c | 24 ++++-----
libgfortran/generated/minloc0_16_r8.c | 24 ++++-----
libgfortran/generated/minloc0_16_s1.c | 16 +++---
libgfortran/generated/minloc0_16_s4.c | 16 +++---
libgfortran/generated/minloc0_4_i1.c | 24 ++++-----
libgfortran/generated/minloc0_4_i16.c | 24 ++++-----
libgfortran/generated/minloc0_4_i2.c | 24 ++++-----
libgfortran/generated/minloc0_4_i4.c | 24 ++++-----
libgfortran/generated/minloc0_4_i8.c | 24 ++++-----
libgfortran/generated/minloc0_4_m1.c | 24 ++++-----
libgfortran/generated/minloc0_4_m16.c | 24 ++++-----
libgfortran/generated/minloc0_4_m2.c | 24 ++++-----
libgfortran/generated/minloc0_4_m4.c | 24 ++++-----
libgfortran/generated/minloc0_4_m8.c | 24 ++++-----
libgfortran/generated/minloc0_4_r10.c | 24 ++++-----
libgfortran/generated/minloc0_4_r16.c | 24 ++++-----
libgfortran/generated/minloc0_4_r17.c | 24 ++++-----
libgfortran/generated/minloc0_4_r4.c | 24 ++++-----
libgfortran/generated/minloc0_4_r8.c | 24 ++++-----
libgfortran/generated/minloc0_4_s1.c | 16 +++---
libgfortran/generated/minloc0_4_s4.c | 16 +++---
libgfortran/generated/minloc0_8_i1.c | 24 ++++-----
libgfortran/generated/minloc0_8_i16.c | 24 ++++-----
libgfortran/generated/minloc0_8_i2.c | 24 ++++-----
libgfortran/generated/minloc0_8_i4.c | 24 ++++-----
libgfortran/generated/minloc0_8_i8.c | 24 ++++-----
libgfortran/generated/minloc0_8_m1.c | 24 ++++-----
libgfortran/generated/minloc0_8_m16.c | 24 ++++-----
libgfortran/generated/minloc0_8_m2.c | 24 ++++-----
libgfortran/generated/minloc0_8_m4.c | 24 ++++-----
libgfortran/generated/minloc0_8_m8.c | 24 ++++-----
libgfortran/generated/minloc0_8_r10.c | 24 ++++-----
libgfortran/generated/minloc0_8_r16.c | 24 ++++-----
libgfortran/generated/minloc0_8_r17.c | 24 ++++-----
libgfortran/generated/minloc0_8_r4.c | 24 ++++-----
libgfortran/generated/minloc0_8_r8.c | 24 ++++-----
libgfortran/generated/minloc0_8_s1.c | 16 +++---
libgfortran/generated/minloc0_8_s4.c | 16 +++---
libgfortran/generated/minloc1_16_i1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_i16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_i2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_i4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_i8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_m1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_m16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_m2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_m4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_m8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_r10.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_r16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_r17.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_r4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_r8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_16_s1.c | 59 ++++++++++----------
libgfortran/generated/minloc1_16_s4.c | 59 ++++++++++----------
libgfortran/generated/minloc1_4_i1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_i16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_i2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_i4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_i8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_m1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_m16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_m2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_m4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_m8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_r10.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_r16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_r17.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_r4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_r8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_4_s1.c | 59 ++++++++++----------
libgfortran/generated/minloc1_4_s4.c | 59 ++++++++++----------
libgfortran/generated/minloc1_8_i1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_i16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_i2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_i4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_i8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_m1.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_m16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_m2.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_m4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_m8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_r10.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_r16.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_r17.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_r4.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_r8.c | 93 ++++++++++++++++++--------------
libgfortran/generated/minloc1_8_s1.c | 59 ++++++++++----------
libgfortran/generated/minloc1_8_s4.c | 59 ++++++++++----------
libgfortran/generated/minloc2_16_s1.c | 10 ++--
libgfortran/generated/minloc2_16_s4.c | 10 ++--
libgfortran/generated/minloc2_4_s1.c | 10 ++--
libgfortran/generated/minloc2_4_s4.c | 10 ++--
libgfortran/generated/minloc2_8_s1.c | 10 ++--
libgfortran/generated/minloc2_8_s4.c | 10 ++--
libgfortran/generated/minval0_s1.c | 16 +++---
libgfortran/generated/minval0_s4.c | 16 +++---
libgfortran/generated/minval1_s1.c | 59 ++++++++++----------
libgfortran/generated/minval1_s4.c | 59 ++++++++++----------
libgfortran/generated/minval_i1.c | 66 +++++++++++++----------
libgfortran/generated/minval_i16.c | 66 +++++++++++++----------
libgfortran/generated/minval_i2.c | 66 +++++++++++++----------
libgfortran/generated/minval_i4.c | 66 +++++++++++++----------
libgfortran/generated/minval_i8.c | 66 +++++++++++++----------
libgfortran/generated/minval_m1.c | 66 +++++++++++++----------
libgfortran/generated/minval_m16.c | 66 +++++++++++++----------
libgfortran/generated/minval_m2.c | 66 +++++++++++++----------
libgfortran/generated/minval_m4.c | 66 +++++++++++++----------
libgfortran/generated/minval_m8.c | 66 +++++++++++++----------
libgfortran/generated/minval_r10.c | 66 +++++++++++++----------
libgfortran/generated/minval_r16.c | 66 +++++++++++++----------
libgfortran/generated/minval_r17.c | 66 +++++++++++++----------
libgfortran/generated/minval_r4.c | 66 +++++++++++++----------
libgfortran/generated/minval_r8.c | 66 +++++++++++++----------
libgfortran/generated/norm2_r10.c | 25 +++++----
libgfortran/generated/norm2_r16.c | 25 +++++----
libgfortran/generated/norm2_r17.c | 25 +++++----
libgfortran/generated/norm2_r4.c | 25 +++++----
libgfortran/generated/norm2_r8.c | 25 +++++----
libgfortran/generated/pack_c10.c | 28 +++++-----
libgfortran/generated/pack_c16.c | 28 +++++-----
libgfortran/generated/pack_c17.c | 28 +++++-----
libgfortran/generated/pack_c4.c | 28 +++++-----
libgfortran/generated/pack_c8.c | 28 +++++-----
libgfortran/generated/pack_i1.c | 28 +++++-----
libgfortran/generated/pack_i16.c | 28 +++++-----
libgfortran/generated/pack_i2.c | 28 +++++-----
libgfortran/generated/pack_i4.c | 28 +++++-----
libgfortran/generated/pack_i8.c | 28 +++++-----
libgfortran/generated/pack_r10.c | 28 +++++-----
libgfortran/generated/pack_r16.c | 28 +++++-----
libgfortran/generated/pack_r17.c | 28 +++++-----
libgfortran/generated/pack_r4.c | 28 +++++-----
libgfortran/generated/pack_r8.c | 28 +++++-----
libgfortran/generated/parity_l1.c | 25 +++++----
libgfortran/generated/parity_l16.c | 25 +++++----
libgfortran/generated/parity_l2.c | 25 +++++----
libgfortran/generated/parity_l4.c | 25 +++++----
libgfortran/generated/parity_l8.c | 25 +++++----
libgfortran/generated/product_c10.c | 59 +++++++++++---------
libgfortran/generated/product_c16.c | 59 +++++++++++---------
libgfortran/generated/product_c17.c | 59 +++++++++++---------
libgfortran/generated/product_c4.c | 59 +++++++++++---------
libgfortran/generated/product_c8.c | 59 +++++++++++---------
libgfortran/generated/product_i1.c | 59 +++++++++++---------
libgfortran/generated/product_i16.c | 59 +++++++++++---------
libgfortran/generated/product_i2.c | 59 +++++++++++---------
libgfortran/generated/product_i4.c | 59 +++++++++++---------
libgfortran/generated/product_i8.c | 59 +++++++++++---------
libgfortran/generated/product_r10.c | 59 +++++++++++---------
libgfortran/generated/product_r16.c | 59 +++++++++++---------
libgfortran/generated/product_r17.c | 59 +++++++++++---------
libgfortran/generated/product_r4.c | 59 +++++++++++---------
libgfortran/generated/product_r8.c | 59 +++++++++++---------
libgfortran/generated/reshape_c10.c | 26 +++++----
libgfortran/generated/reshape_c16.c | 26 +++++----
libgfortran/generated/reshape_c17.c | 26 +++++----
libgfortran/generated/reshape_c4.c | 26 +++++----
libgfortran/generated/reshape_c8.c | 26 +++++----
libgfortran/generated/reshape_i16.c | 26 +++++----
libgfortran/generated/reshape_i4.c | 26 +++++----
libgfortran/generated/reshape_i8.c | 26 +++++----
libgfortran/generated/reshape_r10.c | 26 +++++----
libgfortran/generated/reshape_r16.c | 26 +++++----
libgfortran/generated/reshape_r17.c | 26 +++++----
libgfortran/generated/reshape_r4.c | 26 +++++----
libgfortran/generated/reshape_r8.c | 26 +++++----
libgfortran/generated/spread_c10.c | 38 ++++++-------
libgfortran/generated/spread_c16.c | 38 ++++++-------
libgfortran/generated/spread_c17.c | 38 ++++++-------
libgfortran/generated/spread_c4.c | 38 ++++++-------
libgfortran/generated/spread_c8.c | 38 ++++++-------
libgfortran/generated/spread_i1.c | 38 ++++++-------
libgfortran/generated/spread_i16.c | 38 ++++++-------
libgfortran/generated/spread_i2.c | 38 ++++++-------
libgfortran/generated/spread_i4.c | 38 ++++++-------
libgfortran/generated/spread_i8.c | 38 ++++++-------
libgfortran/generated/spread_r10.c | 38 ++++++-------
libgfortran/generated/spread_r16.c | 38 ++++++-------
libgfortran/generated/spread_r17.c | 38 ++++++-------
libgfortran/generated/spread_r4.c | 38 ++++++-------
libgfortran/generated/spread_r8.c | 38 ++++++-------
libgfortran/generated/sum_c10.c | 59 +++++++++++---------
libgfortran/generated/sum_c16.c | 59 +++++++++++---------
libgfortran/generated/sum_c17.c | 59 +++++++++++---------
libgfortran/generated/sum_c4.c | 59 +++++++++++---------
libgfortran/generated/sum_c8.c | 59 +++++++++++---------
libgfortran/generated/sum_i1.c | 59 +++++++++++---------
libgfortran/generated/sum_i16.c | 59 +++++++++++---------
libgfortran/generated/sum_i2.c | 59 +++++++++++---------
libgfortran/generated/sum_i4.c | 59 +++++++++++---------
libgfortran/generated/sum_i8.c | 59 +++++++++++---------
libgfortran/generated/sum_r10.c | 59 +++++++++++---------
libgfortran/generated/sum_r16.c | 59 +++++++++++---------
libgfortran/generated/sum_r17.c | 59 +++++++++++---------
libgfortran/generated/sum_r4.c | 59 +++++++++++---------
libgfortran/generated/sum_r8.c | 59 +++++++++++---------
libgfortran/generated/unpack_c10.c | 44 +++++++--------
libgfortran/generated/unpack_c16.c | 44 +++++++--------
libgfortran/generated/unpack_c17.c | 44 +++++++--------
libgfortran/generated/unpack_c4.c | 44 +++++++--------
libgfortran/generated/unpack_c8.c | 44 +++++++--------
libgfortran/generated/unpack_i1.c | 44 +++++++--------
libgfortran/generated/unpack_i16.c | 44 +++++++--------
libgfortran/generated/unpack_i2.c | 44 +++++++--------
libgfortran/generated/unpack_i4.c | 44 +++++++--------
libgfortran/generated/unpack_i8.c | 44 +++++++--------
libgfortran/generated/unpack_r10.c | 44 +++++++--------
libgfortran/generated/unpack_r16.c | 44 +++++++--------
libgfortran/generated/unpack_r17.c | 44 +++++++--------
libgfortran/generated/unpack_r4.c | 44 +++++++--------
libgfortran/generated/unpack_r8.c | 44 +++++++--------
550 files changed, 13989 insertions(+), 11742 deletions(-)
diff --git a/libgfortran/generated/all_l1.c b/libgfortran/generated/all_l1.c
index 61257324c080..fafdb05209e2 100644
--- a/libgfortran/generated/all_l1.c
+++ b/libgfortran/generated/all_l1.c
@@ -131,7 +131,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -166,7 +166,7 @@ all_l1 (gfc_array_l1 * const restrict retarray,
*dest = 1;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (! *src)
@@ -174,14 +174,15 @@ all_l1 (gfc_array_l1 * const restrict retarray,
result = 0;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ all_l1 (gfc_array_l1 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ all_l1 (gfc_array_l1 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/all_l16.c b/libgfortran/generated/all_l16.c
index 43f1ee546f4f..3a070ecd5413 100644
--- a/libgfortran/generated/all_l16.c
+++ b/libgfortran/generated/all_l16.c
@@ -131,7 +131,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -166,7 +166,7 @@ all_l16 (gfc_array_l16 * const restrict retarray,
*dest = 1;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (! *src)
@@ -174,14 +174,15 @@ all_l16 (gfc_array_l16 * const restrict retarray,
result = 0;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ all_l16 (gfc_array_l16 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ all_l16 (gfc_array_l16 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/all_l2.c b/libgfortran/generated/all_l2.c
index 50ba30923137..6d6de77b5d99 100644
--- a/libgfortran/generated/all_l2.c
+++ b/libgfortran/generated/all_l2.c
@@ -131,7 +131,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -166,7 +166,7 @@ all_l2 (gfc_array_l2 * const restrict retarray,
*dest = 1;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (! *src)
@@ -174,14 +174,15 @@ all_l2 (gfc_array_l2 * const restrict retarray,
result = 0;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ all_l2 (gfc_array_l2 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ all_l2 (gfc_array_l2 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c
index 06b42fd417f7..aedb1db2b907 100644
--- a/libgfortran/generated/all_l4.c
+++ b/libgfortran/generated/all_l4.c
@@ -131,7 +131,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -166,7 +166,7 @@ all_l4 (gfc_array_l4 * const restrict retarray,
*dest = 1;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (! *src)
@@ -174,14 +174,15 @@ all_l4 (gfc_array_l4 * const restrict retarray,
result = 0;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ all_l4 (gfc_array_l4 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ all_l4 (gfc_array_l4 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c
index 46c83df5f513..1a7d8c025b06 100644
--- a/libgfortran/generated/all_l8.c
+++ b/libgfortran/generated/all_l8.c
@@ -131,7 +131,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -166,7 +166,7 @@ all_l8 (gfc_array_l8 * const restrict retarray,
*dest = 1;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (! *src)
@@ -174,14 +174,15 @@ all_l8 (gfc_array_l8 * const restrict retarray,
result = 0;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ all_l8 (gfc_array_l8 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ all_l8 (gfc_array_l8 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/any_l1.c b/libgfortran/generated/any_l1.c
index 46e08798e21c..fd9ec847cf51 100644
--- a/libgfortran/generated/any_l1.c
+++ b/libgfortran/generated/any_l1.c
@@ -131,7 +131,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,7 +165,7 @@ any_l1 (gfc_array_l1 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
/* Return true if any of the elements are set. */
@@ -174,14 +174,15 @@ any_l1 (gfc_array_l1 * const restrict retarray,
result = 1;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ any_l1 (gfc_array_l1 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ any_l1 (gfc_array_l1 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/any_l16.c b/libgfortran/generated/any_l16.c
index 1f38d9dc452c..aa803868216c 100644
--- a/libgfortran/generated/any_l16.c
+++ b/libgfortran/generated/any_l16.c
@@ -131,7 +131,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,7 +165,7 @@ any_l16 (gfc_array_l16 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
/* Return true if any of the elements are set. */
@@ -174,14 +174,15 @@ any_l16 (gfc_array_l16 * const restrict retarray,
result = 1;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ any_l16 (gfc_array_l16 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ any_l16 (gfc_array_l16 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/any_l2.c b/libgfortran/generated/any_l2.c
index 98207b2c2a2d..9dbe864b0e95 100644
--- a/libgfortran/generated/any_l2.c
+++ b/libgfortran/generated/any_l2.c
@@ -131,7 +131,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,7 +165,7 @@ any_l2 (gfc_array_l2 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
/* Return true if any of the elements are set. */
@@ -174,14 +174,15 @@ any_l2 (gfc_array_l2 * const restrict retarray,
result = 1;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ any_l2 (gfc_array_l2 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ any_l2 (gfc_array_l2 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c
index 42e09c7d4661..dfdb5e697276 100644
--- a/libgfortran/generated/any_l4.c
+++ b/libgfortran/generated/any_l4.c
@@ -131,7 +131,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,7 +165,7 @@ any_l4 (gfc_array_l4 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
/* Return true if any of the elements are set. */
@@ -174,14 +174,15 @@ any_l4 (gfc_array_l4 * const restrict retarray,
result = 1;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ any_l4 (gfc_array_l4 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ any_l4 (gfc_array_l4 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c
index 000fbda5627e..8ff8f563eca8 100644
--- a/libgfortran/generated/any_l8.c
+++ b/libgfortran/generated/any_l8.c
@@ -131,7 +131,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,7 +165,7 @@ any_l8 (gfc_array_l8 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
/* Return true if any of the elements are set. */
@@ -174,14 +174,15 @@ any_l8 (gfc_array_l8 * const restrict retarray,
result = 1;
break;
}
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -190,8 +191,8 @@ any_l8 (gfc_array_l8 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -202,8 +203,8 @@ any_l8 (gfc_array_l8 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/count_16_l.c b/libgfortran/generated/count_16_l.c
index 1af2893c5b3c..d514c1f5551f 100644
--- a/libgfortran/generated/count_16_l.c
+++ b/libgfortran/generated/count_16_l.c
@@ -131,7 +131,7 @@ count_16_l (gfc_array_i16 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,19 +165,20 @@ count_16_l (gfc_array_i16 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (*src)
result++;
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -186,8 +187,8 @@ count_16_l (gfc_array_i16 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -198,8 +199,8 @@ count_16_l (gfc_array_i16 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/count_1_l.c b/libgfortran/generated/count_1_l.c
index 00a8799d97f6..f60e49c492f7 100644
--- a/libgfortran/generated/count_1_l.c
+++ b/libgfortran/generated/count_1_l.c
@@ -131,7 +131,7 @@ count_1_l (gfc_array_i1 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,19 +165,20 @@ count_1_l (gfc_array_i1 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (*src)
result++;
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -186,8 +187,8 @@ count_1_l (gfc_array_i1 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -198,8 +199,8 @@ count_1_l (gfc_array_i1 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/count_2_l.c b/libgfortran/generated/count_2_l.c
index 3af433425198..75c676bc9e62 100644
--- a/libgfortran/generated/count_2_l.c
+++ b/libgfortran/generated/count_2_l.c
@@ -131,7 +131,7 @@ count_2_l (gfc_array_i2 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,19 +165,20 @@ count_2_l (gfc_array_i2 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (*src)
result++;
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -186,8 +187,8 @@ count_2_l (gfc_array_i2 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -198,8 +199,8 @@ count_2_l (gfc_array_i2 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/count_4_l.c b/libgfortran/generated/count_4_l.c
index 59409bc25791..c03ca930736b 100644
--- a/libgfortran/generated/count_4_l.c
+++ b/libgfortran/generated/count_4_l.c
@@ -131,7 +131,7 @@ count_4_l (gfc_array_i4 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,19 +165,20 @@ count_4_l (gfc_array_i4 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (*src)
result++;
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -186,8 +187,8 @@ count_4_l (gfc_array_i4 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -198,8 +199,8 @@ count_4_l (gfc_array_i4 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/count_8_l.c b/libgfortran/generated/count_8_l.c
index dd00fcb0c1c5..e4ab3bbc9b27 100644
--- a/libgfortran/generated/count_8_l.c
+++ b/libgfortran/generated/count_8_l.c
@@ -131,7 +131,7 @@ count_8_l (gfc_array_i8 * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -165,19 +165,20 @@ count_8_l (gfc_array_i8 * const restrict retarray,
*dest = 0;
else
{
- for (n = 0; n < len; n++, src += delta)
+ for (n = 0; n < len; n++)
{
if (*src)
result++;
- }
+ PTR_INCREMENT_BYTES (src, delta);
+ }
*dest = result;
}
}
/* Advance to the next element. */
count[0]++;
- base += sstride[0];
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
@@ -186,8 +187,8 @@ count_8_l (gfc_array_i8 * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
base -= sstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -198,8 +199,8 @@ count_8_l (gfc_array_i8 * const restrict retarray,
else
{
count[n]++;
- base += sstride[n];
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_c10.c b/libgfortran/generated/cshift0_c10.c
index 41a9935ecb07..f7e2947aaf9d 100644
--- a/libgfortran/generated/cshift0_c10.c
+++ b/libgfortran/generated/cshift0_c10.c
@@ -111,10 +111,10 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_10);
+ rstride[0] = sizeof (GFC_COMPLEX_10);
+ roffset = sizeof (GFC_COMPLEX_10);
+ soffset = sizeof (GFC_COMPLEX_10);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_10);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_10) && roffset == sizeof (GFC_COMPLEX_10))
{
size_t len1 = shift * sizeof (GFC_COMPLEX_10);
size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_10);
@@ -190,25 +190,25 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_COMPLEX_10 *dest = rptr;
- const GFC_COMPLEX_10 *src = &sptr[shift * soffset];
+ const GFC_COMPLEX_10 *src = (const GFC_COMPLEX_10 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_c16.c b/libgfortran/generated/cshift0_c16.c
index aa9b038ffa9c..5326c1fb2833 100644
--- a/libgfortran/generated/cshift0_c16.c
+++ b/libgfortran/generated/cshift0_c16.c
@@ -111,10 +111,10 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_16);
+ rstride[0] = sizeof (GFC_COMPLEX_16);
+ roffset = sizeof (GFC_COMPLEX_16);
+ soffset = sizeof (GFC_COMPLEX_16);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_16);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_16) && roffset == sizeof (GFC_COMPLEX_16))
{
size_t len1 = shift * sizeof (GFC_COMPLEX_16);
size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_16);
@@ -190,25 +190,25 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_COMPLEX_16 *dest = rptr;
- const GFC_COMPLEX_16 *src = &sptr[shift * soffset];
+ const GFC_COMPLEX_16 *src = (const GFC_COMPLEX_16 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_c17.c b/libgfortran/generated/cshift0_c17.c
index 93f9b2e4dd5f..3309c8dfe96b 100644
--- a/libgfortran/generated/cshift0_c17.c
+++ b/libgfortran/generated/cshift0_c17.c
@@ -111,10 +111,10 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_17);
+ rstride[0] = sizeof (GFC_COMPLEX_17);
+ roffset = sizeof (GFC_COMPLEX_17);
+ soffset = sizeof (GFC_COMPLEX_17);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_17);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_17) && roffset == sizeof (GFC_COMPLEX_17))
{
size_t len1 = shift * sizeof (GFC_COMPLEX_17);
size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_17);
@@ -190,25 +190,25 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_COMPLEX_17 *dest = rptr;
- const GFC_COMPLEX_17 *src = &sptr[shift * soffset];
+ const GFC_COMPLEX_17 *src = (const GFC_COMPLEX_17 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_c17 (gfc_array_c17 *ret, const gfc_array_c17 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_c4.c b/libgfortran/generated/cshift0_c4.c
index 7583c4fd7713..64090375ba00 100644
--- a/libgfortran/generated/cshift0_c4.c
+++ b/libgfortran/generated/cshift0_c4.c
@@ -111,10 +111,10 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_4);
+ rstride[0] = sizeof (GFC_COMPLEX_4);
+ roffset = sizeof (GFC_COMPLEX_4);
+ soffset = sizeof (GFC_COMPLEX_4);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_4);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_4) && roffset == sizeof (GFC_COMPLEX_4))
{
size_t len1 = shift * sizeof (GFC_COMPLEX_4);
size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_4);
@@ -190,25 +190,25 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_COMPLEX_4 *dest = rptr;
- const GFC_COMPLEX_4 *src = &sptr[shift * soffset];
+ const GFC_COMPLEX_4 *src = (const GFC_COMPLEX_4 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_c4 (gfc_array_c4 *ret, const gfc_array_c4 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_c8.c b/libgfortran/generated/cshift0_c8.c
index b7a9b65c1dfa..756c0bb2bea2 100644
--- a/libgfortran/generated/cshift0_c8.c
+++ b/libgfortran/generated/cshift0_c8.c
@@ -111,10 +111,10 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_8);
+ rstride[0] = sizeof (GFC_COMPLEX_8);
+ roffset = sizeof (GFC_COMPLEX_8);
+ soffset = sizeof (GFC_COMPLEX_8);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_8);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_8) && roffset == sizeof (GFC_COMPLEX_8))
{
size_t len1 = shift * sizeof (GFC_COMPLEX_8);
size_t len2 = (len - shift) * sizeof (GFC_COMPLEX_8);
@@ -190,25 +190,25 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_COMPLEX_8 *dest = rptr;
- const GFC_COMPLEX_8 *src = &sptr[shift * soffset];
+ const GFC_COMPLEX_8 *src = (const GFC_COMPLEX_8 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_c8 (gfc_array_c8 *ret, const gfc_array_c8 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_i1.c b/libgfortran/generated/cshift0_i1.c
index 36f95ec2640f..e2bfebd2ece0 100644
--- a/libgfortran/generated/cshift0_i1.c
+++ b/libgfortran/generated/cshift0_i1.c
@@ -111,10 +111,10 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_INTEGER_1);
+ rstride[0] = sizeof (GFC_INTEGER_1);
+ roffset = sizeof (GFC_INTEGER_1);
+ soffset = sizeof (GFC_INTEGER_1);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_1);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_1);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_1);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_1);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_1) && roffset == sizeof (GFC_INTEGER_1))
{
size_t len1 = shift * sizeof (GFC_INTEGER_1);
size_t len2 = (len - shift) * sizeof (GFC_INTEGER_1);
@@ -190,25 +190,25 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_INTEGER_1 *dest = rptr;
- const GFC_INTEGER_1 *src = &sptr[shift * soffset];
+ const GFC_INTEGER_1 *src = (const GFC_INTEGER_1 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_i16.c b/libgfortran/generated/cshift0_i16.c
index 1d65186576d1..b34d12a0bef3 100644
--- a/libgfortran/generated/cshift0_i16.c
+++ b/libgfortran/generated/cshift0_i16.c
@@ -111,10 +111,10 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_INTEGER_16);
+ rstride[0] = sizeof (GFC_INTEGER_16);
+ roffset = sizeof (GFC_INTEGER_16);
+ soffset = sizeof (GFC_INTEGER_16);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_16) && roffset == sizeof (GFC_INTEGER_16))
{
size_t len1 = shift * sizeof (GFC_INTEGER_16);
size_t len2 = (len - shift) * sizeof (GFC_INTEGER_16);
@@ -190,25 +190,25 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_INTEGER_16 *dest = rptr;
- const GFC_INTEGER_16 *src = &sptr[shift * soffset];
+ const GFC_INTEGER_16 *src = (const GFC_INTEGER_16 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_i2.c b/libgfortran/generated/cshift0_i2.c
index 838a7a4e594e..07b975a34236 100644
--- a/libgfortran/generated/cshift0_i2.c
+++ b/libgfortran/generated/cshift0_i2.c
@@ -111,10 +111,10 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_INTEGER_2);
+ rstride[0] = sizeof (GFC_INTEGER_2);
+ roffset = sizeof (GFC_INTEGER_2);
+ soffset = sizeof (GFC_INTEGER_2);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_2);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_2);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_2);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_2);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_2) && roffset == sizeof (GFC_INTEGER_2))
{
size_t len1 = shift * sizeof (GFC_INTEGER_2);
size_t len2 = (len - shift) * sizeof (GFC_INTEGER_2);
@@ -190,25 +190,25 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_INTEGER_2 *dest = rptr;
- const GFC_INTEGER_2 *src = &sptr[shift * soffset];
+ const GFC_INTEGER_2 *src = (const GFC_INTEGER_2 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_i2 (gfc_array_i2 *ret, const gfc_array_i2 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_i4.c b/libgfortran/generated/cshift0_i4.c
index 17236b5fcbc5..28ca14c35f3b 100644
--- a/libgfortran/generated/cshift0_i4.c
+++ b/libgfortran/generated/cshift0_i4.c
@@ -111,10 +111,10 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_INTEGER_4);
+ rstride[0] = sizeof (GFC_INTEGER_4);
+ roffset = sizeof (GFC_INTEGER_4);
+ soffset = sizeof (GFC_INTEGER_4);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_4) && roffset == sizeof (GFC_INTEGER_4))
{
size_t len1 = shift * sizeof (GFC_INTEGER_4);
size_t len2 = (len - shift) * sizeof (GFC_INTEGER_4);
@@ -190,25 +190,25 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_INTEGER_4 *dest = rptr;
- const GFC_INTEGER_4 *src = &sptr[shift * soffset];
+ const GFC_INTEGER_4 *src = (const GFC_INTEGER_4 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_i4 (gfc_array_i4 *ret, const gfc_array_i4 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_i8.c b/libgfortran/generated/cshift0_i8.c
index 980663155c65..76f6f5aac62b 100644
--- a/libgfortran/generated/cshift0_i8.c
+++ b/libgfortran/generated/cshift0_i8.c
@@ -111,10 +111,10 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_INTEGER_8);
+ rstride[0] = sizeof (GFC_INTEGER_8);
+ roffset = sizeof (GFC_INTEGER_8);
+ soffset = sizeof (GFC_INTEGER_8);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_8) && roffset == sizeof (GFC_INTEGER_8))
{
size_t len1 = shift * sizeof (GFC_INTEGER_8);
size_t len2 = (len - shift) * sizeof (GFC_INTEGER_8);
@@ -190,25 +190,25 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_INTEGER_8 *dest = rptr;
- const GFC_INTEGER_8 *src = &sptr[shift * soffset];
+ const GFC_INTEGER_8 *src = (const GFC_INTEGER_8 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_i8 (gfc_array_i8 *ret, const gfc_array_i8 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_r10.c b/libgfortran/generated/cshift0_r10.c
index 941d6ca9ff28..7b4406d3bad8 100644
--- a/libgfortran/generated/cshift0_r10.c
+++ b/libgfortran/generated/cshift0_r10.c
@@ -111,10 +111,10 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_REAL_10);
+ rstride[0] = sizeof (GFC_REAL_10);
+ roffset = sizeof (GFC_REAL_10);
+ soffset = sizeof (GFC_REAL_10);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_10);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_10) && roffset == sizeof (GFC_REAL_10))
{
size_t len1 = shift * sizeof (GFC_REAL_10);
size_t len2 = (len - shift) * sizeof (GFC_REAL_10);
@@ -190,25 +190,25 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_REAL_10 *dest = rptr;
- const GFC_REAL_10 *src = &sptr[shift * soffset];
+ const GFC_REAL_10 *src = (const GFC_REAL_10 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_r10 (gfc_array_r10 *ret, const gfc_array_r10 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_r16.c b/libgfortran/generated/cshift0_r16.c
index 8aac5b0298ef..fea3900f3368 100644
--- a/libgfortran/generated/cshift0_r16.c
+++ b/libgfortran/generated/cshift0_r16.c
@@ -111,10 +111,10 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_REAL_16);
+ rstride[0] = sizeof (GFC_REAL_16);
+ roffset = sizeof (GFC_REAL_16);
+ soffset = sizeof (GFC_REAL_16);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_16);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_16) && roffset == sizeof (GFC_REAL_16))
{
size_t len1 = shift * sizeof (GFC_REAL_16);
size_t len2 = (len - shift) * sizeof (GFC_REAL_16);
@@ -190,25 +190,25 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_REAL_16 *dest = rptr;
- const GFC_REAL_16 *src = &sptr[shift * soffset];
+ const GFC_REAL_16 *src = (const GFC_REAL_16 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_r16 (gfc_array_r16 *ret, const gfc_array_r16 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_r17.c b/libgfortran/generated/cshift0_r17.c
index 0288573797bd..e4a056d7d146 100644
--- a/libgfortran/generated/cshift0_r17.c
+++ b/libgfortran/generated/cshift0_r17.c
@@ -111,10 +111,10 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_REAL_17);
+ rstride[0] = sizeof (GFC_REAL_17);
+ roffset = sizeof (GFC_REAL_17);
+ soffset = sizeof (GFC_REAL_17);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_17);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_17) && roffset == sizeof (GFC_REAL_17))
{
size_t len1 = shift * sizeof (GFC_REAL_17);
size_t len2 = (len - shift) * sizeof (GFC_REAL_17);
@@ -190,25 +190,25 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_REAL_17 *dest = rptr;
- const GFC_REAL_17 *src = &sptr[shift * soffset];
+ const GFC_REAL_17 *src = (const GFC_REAL_17 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_r17 (gfc_array_r17 *ret, const gfc_array_r17 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_r4.c b/libgfortran/generated/cshift0_r4.c
index 5acddeb37b27..82f8182a17fa 100644
--- a/libgfortran/generated/cshift0_r4.c
+++ b/libgfortran/generated/cshift0_r4.c
@@ -111,10 +111,10 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_REAL_4);
+ rstride[0] = sizeof (GFC_REAL_4);
+ roffset = sizeof (GFC_REAL_4);
+ soffset = sizeof (GFC_REAL_4);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_4);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_4) && roffset == sizeof (GFC_REAL_4))
{
size_t len1 = shift * sizeof (GFC_REAL_4);
size_t len2 = (len - shift) * sizeof (GFC_REAL_4);
@@ -190,25 +190,25 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_REAL_4 *dest = rptr;
- const GFC_REAL_4 *src = &sptr[shift * soffset];
+ const GFC_REAL_4 *src = (const GFC_REAL_4 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_r4 (gfc_array_r4 *ret, const gfc_array_r4 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift0_r8.c b/libgfortran/generated/cshift0_r8.c
index e6dbbd66c3b9..08da8bb81c73 100644
--- a/libgfortran/generated/cshift0_r8.c
+++ b/libgfortran/generated/cshift0_r8.c
@@ -111,10 +111,10 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
bn = cshift(a,sh*n1*n2,1)
we can used a more blocked algorithm for dim>1. */
- sstride[0] = 1;
- rstride[0] = 1;
- roffset = 1;
- soffset = 1;
+ sstride[0] = sizeof (GFC_REAL_8);
+ rstride[0] = sizeof (GFC_REAL_8);
+ roffset = sizeof (GFC_REAL_8);
+ soffset = sizeof (GFC_REAL_8);
len = GFC_DESCRIPTOR_STRIDE(array, which)
* GFC_DESCRIPTOR_EXTENT(array, which);
shift *= GFC_DESCRIPTOR_STRIDE(array, which);
@@ -122,8 +122,8 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
dim = GFC_DESCRIPTOR_RANK (array) - which;
@@ -134,27 +134,27 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
n++;
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_8);
dim = GFC_DESCRIPTOR_RANK (array);
}
@@ -178,7 +178,7 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
/* If elements are contiguous, perform the operation
in two block moves. */
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_8) && roffset == sizeof (GFC_REAL_8))
{
size_t len1 = shift * sizeof (GFC_REAL_8);
size_t len2 = (len - shift) * sizeof (GFC_REAL_8);
@@ -190,25 +190,25 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
/* Otherwise, we will have to perform the copy one element at
a time. */
GFC_REAL_8 *dest = rptr;
- const GFC_REAL_8 *src = &sptr[shift * soffset];
+ const GFC_REAL_8 *src = (const GFC_REAL_8 *) (((char*)sptr) + shift * soffset);
for (n = 0; n < len - shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < shift; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -218,8 +218,8 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- rptr -= rstride[n] * extent[n];
- sptr -= sstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (rptr, rstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (sptr, sstride[n] * extent[n]);
n++;
if (n >= dim - 1)
{
@@ -230,8 +230,8 @@ cshift0_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array, ptrdiff_t shift,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c
index 2906edeb4162..80e1a9ccb5a0 100644
--- a/libgfortran/generated/cshift1_16.c
+++ b/libgfortran/generated/cshift1_16.c
@@ -229,7 +229,7 @@ cshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -238,7 +238,7 @@ cshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -291,7 +291,7 @@ cshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -301,9 +301,9 @@ cshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -316,7 +316,7 @@ cshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_c10.c b/libgfortran/generated/cshift1_16_c10.c
index fc31e697fcde..82d97fda8317 100644
--- a/libgfortran/generated/cshift1_16_c10.c
+++ b/libgfortran/generated/cshift1_16_c10.c
@@ -83,21 +83,21 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_10) && roffset == sizeof (GFC_COMPLEX_10))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_10);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_10);
@@ -147,21 +147,21 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_c10 (gfc_array_c10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_c16.c b/libgfortran/generated/cshift1_16_c16.c
index f5d7b68b26fd..2f4c6b47d882 100644
--- a/libgfortran/generated/cshift1_16_c16.c
+++ b/libgfortran/generated/cshift1_16_c16.c
@@ -83,21 +83,21 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_16) && roffset == sizeof (GFC_COMPLEX_16))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_16);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_16);
@@ -147,21 +147,21 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_c16 (gfc_array_c16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_c17.c b/libgfortran/generated/cshift1_16_c17.c
index 689da3fd3363..154021e50ee1 100644
--- a/libgfortran/generated/cshift1_16_c17.c
+++ b/libgfortran/generated/cshift1_16_c17.c
@@ -83,21 +83,21 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_17) && roffset == sizeof (GFC_COMPLEX_17))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_17);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_17);
@@ -147,21 +147,21 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_c17 (gfc_array_c17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_c4.c b/libgfortran/generated/cshift1_16_c4.c
index df7adbb3c3bd..a14bf888bc04 100644
--- a/libgfortran/generated/cshift1_16_c4.c
+++ b/libgfortran/generated/cshift1_16_c4.c
@@ -83,21 +83,21 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_4) && roffset == sizeof (GFC_COMPLEX_4))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_4);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_4);
@@ -147,21 +147,21 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_c4 (gfc_array_c4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_c8.c b/libgfortran/generated/cshift1_16_c8.c
index ea0a3ef00d55..6ae7f93ec3a4 100644
--- a/libgfortran/generated/cshift1_16_c8.c
+++ b/libgfortran/generated/cshift1_16_c8.c
@@ -83,21 +83,21 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_8) && roffset == sizeof (GFC_COMPLEX_8))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_8);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_8);
@@ -147,21 +147,21 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_c8 (gfc_array_c8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_i1.c b/libgfortran/generated/cshift1_16_i1.c
index adb09917000a..f1027f85028d 100644
--- a/libgfortran/generated/cshift1_16_i1.c
+++ b/libgfortran/generated/cshift1_16_i1.c
@@ -83,21 +83,21 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_1);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_1);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_1);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_1);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_1 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_1) && roffset == sizeof (GFC_INTEGER_1))
{
size_t len1 = sh * sizeof (GFC_INTEGER_1);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_1);
@@ -147,21 +147,21 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_i1 (gfc_array_i1 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_i16.c b/libgfortran/generated/cshift1_16_i16.c
index 5f0ed71f8cab..29b24d5ad8af 100644
--- a/libgfortran/generated/cshift1_16_i16.c
+++ b/libgfortran/generated/cshift1_16_i16.c
@@ -83,21 +83,21 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_16) && roffset == sizeof (GFC_INTEGER_16))
{
size_t len1 = sh * sizeof (GFC_INTEGER_16);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_16);
@@ -147,21 +147,21 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_i16 (gfc_array_i16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_i2.c b/libgfortran/generated/cshift1_16_i2.c
index c144c67bf95b..27f38b6428b1 100644
--- a/libgfortran/generated/cshift1_16_i2.c
+++ b/libgfortran/generated/cshift1_16_i2.c
@@ -83,21 +83,21 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_2);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_2);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_2);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_2);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_2 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_2) && roffset == sizeof (GFC_INTEGER_2))
{
size_t len1 = sh * sizeof (GFC_INTEGER_2);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_2);
@@ -147,21 +147,21 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_i2 (gfc_array_i2 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_i4.c b/libgfortran/generated/cshift1_16_i4.c
index 8572905bf696..4c1026a5bdec 100644
--- a/libgfortran/generated/cshift1_16_i4.c
+++ b/libgfortran/generated/cshift1_16_i4.c
@@ -83,21 +83,21 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_4) && roffset == sizeof (GFC_INTEGER_4))
{
size_t len1 = sh * sizeof (GFC_INTEGER_4);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_4);
@@ -147,21 +147,21 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_i4 (gfc_array_i4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_i8.c b/libgfortran/generated/cshift1_16_i8.c
index cd88fd99634c..e887c3e6d64a 100644
--- a/libgfortran/generated/cshift1_16_i8.c
+++ b/libgfortran/generated/cshift1_16_i8.c
@@ -83,21 +83,21 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_8) && roffset == sizeof (GFC_INTEGER_8))
{
size_t len1 = sh * sizeof (GFC_INTEGER_8);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_8);
@@ -147,21 +147,21 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_i8 (gfc_array_i8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_r10.c b/libgfortran/generated/cshift1_16_r10.c
index 849441d2e88f..ba4671d2522c 100644
--- a/libgfortran/generated/cshift1_16_r10.c
+++ b/libgfortran/generated/cshift1_16_r10.c
@@ -83,21 +83,21 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_10) && roffset == sizeof (GFC_REAL_10))
{
size_t len1 = sh * sizeof (GFC_REAL_10);
size_t len2 = (len - sh) * sizeof (GFC_REAL_10);
@@ -147,21 +147,21 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_r10 (gfc_array_r10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_r16.c b/libgfortran/generated/cshift1_16_r16.c
index 22708dcc2fe3..b37066485799 100644
--- a/libgfortran/generated/cshift1_16_r16.c
+++ b/libgfortran/generated/cshift1_16_r16.c
@@ -83,21 +83,21 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_16) && roffset == sizeof (GFC_REAL_16))
{
size_t len1 = sh * sizeof (GFC_REAL_16);
size_t len2 = (len - sh) * sizeof (GFC_REAL_16);
@@ -147,21 +147,21 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_r16 (gfc_array_r16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_r17.c b/libgfortran/generated/cshift1_16_r17.c
index 8943fafda64a..0503312a6fac 100644
--- a/libgfortran/generated/cshift1_16_r17.c
+++ b/libgfortran/generated/cshift1_16_r17.c
@@ -83,21 +83,21 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_17) && roffset == sizeof (GFC_REAL_17))
{
size_t len1 = sh * sizeof (GFC_REAL_17);
size_t len2 = (len - sh) * sizeof (GFC_REAL_17);
@@ -147,21 +147,21 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_r17 (gfc_array_r17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_r4.c b/libgfortran/generated/cshift1_16_r4.c
index 0763760c0a66..8fa510861ca9 100644
--- a/libgfortran/generated/cshift1_16_r4.c
+++ b/libgfortran/generated/cshift1_16_r4.c
@@ -83,21 +83,21 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_4) && roffset == sizeof (GFC_REAL_4))
{
size_t len1 = sh * sizeof (GFC_REAL_4);
size_t len2 = (len - sh) * sizeof (GFC_REAL_4);
@@ -147,21 +147,21 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_r4 (gfc_array_r4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_16_r8.c b/libgfortran/generated/cshift1_16_r8.c
index dad13a4f0f38..d6382f0925eb 100644
--- a/libgfortran/generated/cshift1_16_r8.c
+++ b/libgfortran/generated/cshift1_16_r8.c
@@ -83,21 +83,21 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_16);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_8) && roffset == sizeof (GFC_REAL_8))
{
size_t len1 = sh * sizeof (GFC_REAL_8);
size_t len2 = (len - sh) * sizeof (GFC_REAL_8);
@@ -147,21 +147,21 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_16_r8 (gfc_array_r8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c
index 8d1851f8655d..72bea1b83913 100644
--- a/libgfortran/generated/cshift1_4.c
+++ b/libgfortran/generated/cshift1_4.c
@@ -229,7 +229,7 @@ cshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -238,7 +238,7 @@ cshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -291,7 +291,7 @@ cshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -301,9 +301,9 @@ cshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -316,7 +316,7 @@ cshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_c10.c b/libgfortran/generated/cshift1_4_c10.c
index b89b673080dd..c941af142198 100644
--- a/libgfortran/generated/cshift1_4_c10.c
+++ b/libgfortran/generated/cshift1_4_c10.c
@@ -83,21 +83,21 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_10) && roffset == sizeof (GFC_COMPLEX_10))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_10);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_10);
@@ -147,21 +147,21 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_c10 (gfc_array_c10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_c16.c b/libgfortran/generated/cshift1_4_c16.c
index 096b3da68b65..498d632b4ee4 100644
--- a/libgfortran/generated/cshift1_4_c16.c
+++ b/libgfortran/generated/cshift1_4_c16.c
@@ -83,21 +83,21 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_16) && roffset == sizeof (GFC_COMPLEX_16))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_16);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_16);
@@ -147,21 +147,21 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_c16 (gfc_array_c16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_c17.c b/libgfortran/generated/cshift1_4_c17.c
index 03e99bd908f3..ad132772e73e 100644
--- a/libgfortran/generated/cshift1_4_c17.c
+++ b/libgfortran/generated/cshift1_4_c17.c
@@ -83,21 +83,21 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_17) && roffset == sizeof (GFC_COMPLEX_17))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_17);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_17);
@@ -147,21 +147,21 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_c17 (gfc_array_c17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_c4.c b/libgfortran/generated/cshift1_4_c4.c
index 4a2b656718a8..595d6607288b 100644
--- a/libgfortran/generated/cshift1_4_c4.c
+++ b/libgfortran/generated/cshift1_4_c4.c
@@ -83,21 +83,21 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_4) && roffset == sizeof (GFC_COMPLEX_4))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_4);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_4);
@@ -147,21 +147,21 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_c4 (gfc_array_c4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_c8.c b/libgfortran/generated/cshift1_4_c8.c
index 9f52c027e51e..09b33f219a77 100644
--- a/libgfortran/generated/cshift1_4_c8.c
+++ b/libgfortran/generated/cshift1_4_c8.c
@@ -83,21 +83,21 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_8) && roffset == sizeof (GFC_COMPLEX_8))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_8);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_8);
@@ -147,21 +147,21 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_c8 (gfc_array_c8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_i1.c b/libgfortran/generated/cshift1_4_i1.c
index 91138e1329d5..cbba837c1bf0 100644
--- a/libgfortran/generated/cshift1_4_i1.c
+++ b/libgfortran/generated/cshift1_4_i1.c
@@ -83,21 +83,21 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_1);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_1);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_1);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_1);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_1 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_1) && roffset == sizeof (GFC_INTEGER_1))
{
size_t len1 = sh * sizeof (GFC_INTEGER_1);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_1);
@@ -147,21 +147,21 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_i1 (gfc_array_i1 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_i16.c b/libgfortran/generated/cshift1_4_i16.c
index 8efbb011ce9b..fd0ab4fd2bb7 100644
--- a/libgfortran/generated/cshift1_4_i16.c
+++ b/libgfortran/generated/cshift1_4_i16.c
@@ -83,21 +83,21 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_16) && roffset == sizeof (GFC_INTEGER_16))
{
size_t len1 = sh * sizeof (GFC_INTEGER_16);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_16);
@@ -147,21 +147,21 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_i16 (gfc_array_i16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_i2.c b/libgfortran/generated/cshift1_4_i2.c
index 58c064b39532..16e31cb72b70 100644
--- a/libgfortran/generated/cshift1_4_i2.c
+++ b/libgfortran/generated/cshift1_4_i2.c
@@ -83,21 +83,21 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_2);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_2);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_2);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_2);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_2 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_2) && roffset == sizeof (GFC_INTEGER_2))
{
size_t len1 = sh * sizeof (GFC_INTEGER_2);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_2);
@@ -147,21 +147,21 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_i2 (gfc_array_i2 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_i4.c b/libgfortran/generated/cshift1_4_i4.c
index d35530b52fa6..9808c8c3e2fd 100644
--- a/libgfortran/generated/cshift1_4_i4.c
+++ b/libgfortran/generated/cshift1_4_i4.c
@@ -83,21 +83,21 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_4) && roffset == sizeof (GFC_INTEGER_4))
{
size_t len1 = sh * sizeof (GFC_INTEGER_4);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_4);
@@ -147,21 +147,21 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_i4 (gfc_array_i4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_i8.c b/libgfortran/generated/cshift1_4_i8.c
index ecd003848ee0..8d88732320ce 100644
--- a/libgfortran/generated/cshift1_4_i8.c
+++ b/libgfortran/generated/cshift1_4_i8.c
@@ -83,21 +83,21 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_8) && roffset == sizeof (GFC_INTEGER_8))
{
size_t len1 = sh * sizeof (GFC_INTEGER_8);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_8);
@@ -147,21 +147,21 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_i8 (gfc_array_i8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_r10.c b/libgfortran/generated/cshift1_4_r10.c
index 4cb9e6dc8493..f389be10b00d 100644
--- a/libgfortran/generated/cshift1_4_r10.c
+++ b/libgfortran/generated/cshift1_4_r10.c
@@ -83,21 +83,21 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_10) && roffset == sizeof (GFC_REAL_10))
{
size_t len1 = sh * sizeof (GFC_REAL_10);
size_t len2 = (len - sh) * sizeof (GFC_REAL_10);
@@ -147,21 +147,21 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_r10 (gfc_array_r10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_r16.c b/libgfortran/generated/cshift1_4_r16.c
index 1784426fcd78..2fa14a47e590 100644
--- a/libgfortran/generated/cshift1_4_r16.c
+++ b/libgfortran/generated/cshift1_4_r16.c
@@ -83,21 +83,21 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_16) && roffset == sizeof (GFC_REAL_16))
{
size_t len1 = sh * sizeof (GFC_REAL_16);
size_t len2 = (len - sh) * sizeof (GFC_REAL_16);
@@ -147,21 +147,21 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_r16 (gfc_array_r16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_r17.c b/libgfortran/generated/cshift1_4_r17.c
index 32a0f507c1ff..1458611a7f47 100644
--- a/libgfortran/generated/cshift1_4_r17.c
+++ b/libgfortran/generated/cshift1_4_r17.c
@@ -83,21 +83,21 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_17) && roffset == sizeof (GFC_REAL_17))
{
size_t len1 = sh * sizeof (GFC_REAL_17);
size_t len2 = (len - sh) * sizeof (GFC_REAL_17);
@@ -147,21 +147,21 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_r17 (gfc_array_r17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_r4.c b/libgfortran/generated/cshift1_4_r4.c
index 4b4db20d99ae..6a1e307e5a79 100644
--- a/libgfortran/generated/cshift1_4_r4.c
+++ b/libgfortran/generated/cshift1_4_r4.c
@@ -83,21 +83,21 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_4) && roffset == sizeof (GFC_REAL_4))
{
size_t len1 = sh * sizeof (GFC_REAL_4);
size_t len2 = (len - sh) * sizeof (GFC_REAL_4);
@@ -147,21 +147,21 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_r4 (gfc_array_r4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_4_r8.c b/libgfortran/generated/cshift1_4_r8.c
index cf76568b9383..b8e7fcf8df64 100644
--- a/libgfortran/generated/cshift1_4_r8.c
+++ b/libgfortran/generated/cshift1_4_r8.c
@@ -83,21 +83,21 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_4);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_8) && roffset == sizeof (GFC_REAL_8))
{
size_t len1 = sh * sizeof (GFC_REAL_8);
size_t len2 = (len - sh) * sizeof (GFC_REAL_8);
@@ -147,21 +147,21 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_4_r8 (gfc_array_r8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c
index 1afb921e8053..c9e682afe42e 100644
--- a/libgfortran/generated/cshift1_8.c
+++ b/libgfortran/generated/cshift1_8.c
@@ -229,7 +229,7 @@ cshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -238,7 +238,7 @@ cshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -291,7 +291,7 @@ cshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -301,9 +301,9 @@ cshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -316,7 +316,7 @@ cshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_c10.c b/libgfortran/generated/cshift1_8_c10.c
index c78fbec090dd..618d2c54b3f2 100644
--- a/libgfortran/generated/cshift1_8_c10.c
+++ b/libgfortran/generated/cshift1_8_c10.c
@@ -83,21 +83,21 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_10) && roffset == sizeof (GFC_COMPLEX_10))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_10);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_10);
@@ -147,21 +147,21 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_c10 (gfc_array_c10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_c16.c b/libgfortran/generated/cshift1_8_c16.c
index cea2c658178d..66b9848960d8 100644
--- a/libgfortran/generated/cshift1_8_c16.c
+++ b/libgfortran/generated/cshift1_8_c16.c
@@ -83,21 +83,21 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_16) && roffset == sizeof (GFC_COMPLEX_16))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_16);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_16);
@@ -147,21 +147,21 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_c16 (gfc_array_c16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_c17.c b/libgfortran/generated/cshift1_8_c17.c
index bc4da3ab473d..21d3709427c9 100644
--- a/libgfortran/generated/cshift1_8_c17.c
+++ b/libgfortran/generated/cshift1_8_c17.c
@@ -83,21 +83,21 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_17) && roffset == sizeof (GFC_COMPLEX_17))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_17);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_17);
@@ -147,21 +147,21 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_c17 (gfc_array_c17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_c4.c b/libgfortran/generated/cshift1_8_c4.c
index 179562e2f060..0088bb7e966f 100644
--- a/libgfortran/generated/cshift1_8_c4.c
+++ b/libgfortran/generated/cshift1_8_c4.c
@@ -83,21 +83,21 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_4) && roffset == sizeof (GFC_COMPLEX_4))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_4);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_4);
@@ -147,21 +147,21 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_c4 (gfc_array_c4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_c8.c b/libgfortran/generated/cshift1_8_c8.c
index 66e4cb7301d6..01a135da4f8f 100644
--- a/libgfortran/generated/cshift1_8_c8.c
+++ b/libgfortran/generated/cshift1_8_c8.c
@@ -83,21 +83,21 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_COMPLEX_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_COMPLEX_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_COMPLEX_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_COMPLEX_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_COMPLEX_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_COMPLEX_8) && roffset == sizeof (GFC_COMPLEX_8))
{
size_t len1 = sh * sizeof (GFC_COMPLEX_8);
size_t len2 = (len - sh) * sizeof (GFC_COMPLEX_8);
@@ -147,21 +147,21 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_c8 (gfc_array_c8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_i1.c b/libgfortran/generated/cshift1_8_i1.c
index d27abbfacf9f..4e306300402c 100644
--- a/libgfortran/generated/cshift1_8_i1.c
+++ b/libgfortran/generated/cshift1_8_i1.c
@@ -83,21 +83,21 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_1);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_1);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_1);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_1);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_1 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_1) && roffset == sizeof (GFC_INTEGER_1))
{
size_t len1 = sh * sizeof (GFC_INTEGER_1);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_1);
@@ -147,21 +147,21 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_i1 (gfc_array_i1 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_i16.c b/libgfortran/generated/cshift1_8_i16.c
index eef8d0eef952..7dbd34b2b182 100644
--- a/libgfortran/generated/cshift1_8_i16.c
+++ b/libgfortran/generated/cshift1_8_i16.c
@@ -83,21 +83,21 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_16) && roffset == sizeof (GFC_INTEGER_16))
{
size_t len1 = sh * sizeof (GFC_INTEGER_16);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_16);
@@ -147,21 +147,21 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_i16 (gfc_array_i16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_i2.c b/libgfortran/generated/cshift1_8_i2.c
index bf6433295b8f..80eb2f58ecdb 100644
--- a/libgfortran/generated/cshift1_8_i2.c
+++ b/libgfortran/generated/cshift1_8_i2.c
@@ -83,21 +83,21 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_2);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_2);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_2);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_2);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_2 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_2) && roffset == sizeof (GFC_INTEGER_2))
{
size_t len1 = sh * sizeof (GFC_INTEGER_2);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_2);
@@ -147,21 +147,21 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_i2 (gfc_array_i2 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_i4.c b/libgfortran/generated/cshift1_8_i4.c
index 6cdf0dbd4b63..48c4954abc56 100644
--- a/libgfortran/generated/cshift1_8_i4.c
+++ b/libgfortran/generated/cshift1_8_i4.c
@@ -83,21 +83,21 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_4) && roffset == sizeof (GFC_INTEGER_4))
{
size_t len1 = sh * sizeof (GFC_INTEGER_4);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_4);
@@ -147,21 +147,21 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_i4 (gfc_array_i4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_i8.c b/libgfortran/generated/cshift1_8_i8.c
index ae2013b8e9e4..16605311c5d4 100644
--- a/libgfortran/generated/cshift1_8_i8.c
+++ b/libgfortran/generated/cshift1_8_i8.c
@@ -83,21 +83,21 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_INTEGER_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_INTEGER_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_INTEGER_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_INTEGER_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_INTEGER_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_INTEGER_8) && roffset == sizeof (GFC_INTEGER_8))
{
size_t len1 = sh * sizeof (GFC_INTEGER_8);
size_t len2 = (len - sh) * sizeof (GFC_INTEGER_8);
@@ -147,21 +147,21 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_i8 (gfc_array_i8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_r10.c b/libgfortran/generated/cshift1_8_r10.c
index 9b422f2d4752..ae92bbf2a505 100644
--- a/libgfortran/generated/cshift1_8_r10.c
+++ b/libgfortran/generated/cshift1_8_r10.c
@@ -83,21 +83,21 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_10);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_10);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_10);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_10);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_10 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_10) && roffset == sizeof (GFC_REAL_10))
{
size_t len1 = sh * sizeof (GFC_REAL_10);
size_t len2 = (len - sh) * sizeof (GFC_REAL_10);
@@ -147,21 +147,21 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_r10 (gfc_array_r10 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_r16.c b/libgfortran/generated/cshift1_8_r16.c
index 6b0d0a396eb1..9bd82ecd220d 100644
--- a/libgfortran/generated/cshift1_8_r16.c
+++ b/libgfortran/generated/cshift1_8_r16.c
@@ -83,21 +83,21 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_16);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_16);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_16);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_16);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_16 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_16) && roffset == sizeof (GFC_REAL_16))
{
size_t len1 = sh * sizeof (GFC_REAL_16);
size_t len2 = (len - sh) * sizeof (GFC_REAL_16);
@@ -147,21 +147,21 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_r16 (gfc_array_r16 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_r17.c b/libgfortran/generated/cshift1_8_r17.c
index 4e01328b0b0c..8014b4491d19 100644
--- a/libgfortran/generated/cshift1_8_r17.c
+++ b/libgfortran/generated/cshift1_8_r17.c
@@ -83,21 +83,21 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_17);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_17);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_17);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_17);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_17 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_17) && roffset == sizeof (GFC_REAL_17))
{
size_t len1 = sh * sizeof (GFC_REAL_17);
size_t len2 = (len - sh) * sizeof (GFC_REAL_17);
@@ -147,21 +147,21 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_r17 (gfc_array_r17 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_r4.c b/libgfortran/generated/cshift1_8_r4.c
index 97b78b45ce06..b62263c7f227 100644
--- a/libgfortran/generated/cshift1_8_r4.c
+++ b/libgfortran/generated/cshift1_8_r4.c
@@ -83,21 +83,21 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_4);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_4);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_4);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_4);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_4 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_4) && roffset == sizeof (GFC_REAL_4))
{
size_t len1 = sh * sizeof (GFC_REAL_4);
size_t len2 = (len - sh) * sizeof (GFC_REAL_4);
@@ -147,21 +147,21 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_r4 (gfc_array_r4 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/cshift1_8_r8.c b/libgfortran/generated/cshift1_8_r8.c
index 055acb3d757d..99d176fc8032 100644
--- a/libgfortran/generated/cshift1_8_r8.c
+++ b/libgfortran/generated/cshift1_8_r8.c
@@ -83,21 +83,21 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE(ret,dim);
+ roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
if (roffset == 0)
- roffset = 1;
- soffset = GFC_DESCRIPTOR_STRIDE(array,dim);
+ roffset = sizeof (GFC_REAL_8);
+ soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
if (soffset == 0)
- soffset = 1;
+ soffset = sizeof (GFC_REAL_8);
len = GFC_DESCRIPTOR_EXTENT(array,dim);
}
else
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
rs_ex[n] = rstride[n] * extent[n];
ss_ex[n] = sstride[n] * extent[n];
hs_ex[n] = hstride[n] * extent[n];
@@ -105,11 +105,11 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
}
}
if (sstride[0] == 0)
- sstride[0] = 1;
+ sstride[0] = sizeof (GFC_REAL_8);
if (rstride[0] == 0)
- rstride[0] = 1;
+ rstride[0] = sizeof (GFC_REAL_8);
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = sizeof (GFC_INTEGER_8);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -133,9 +133,9 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
if (sh < 0)
sh += len;
}
- src = &sptr[sh * soffset];
+ src = (const GFC_REAL_8 *) (((char*)sptr) + sh * soffset);
dest = rptr;
- if (soffset == 1 && roffset == 1)
+ if (soffset == sizeof (GFC_REAL_8) && roffset == sizeof (GFC_REAL_8))
{
size_t len1 = sh * sizeof (GFC_REAL_8);
size_t len2 = (len - sh) * sizeof (GFC_REAL_8);
@@ -147,21 +147,21 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
for (n = 0; n < len - sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
for (src = sptr, n = 0; n < sh; n++)
{
*dest = *src;
- dest += roffset;
- src += soffset;
+ PTR_INCREMENT_BYTES (dest, roffset);
+ PTR_INCREMENT_BYTES (src, soffset);
}
}
/* Advance to the next section. */
- rptr += rstride0;
- sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (rptr, rstride0);
+ PTR_INCREMENT_BYTES (sptr, sstride0);
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -169,9 +169,9 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
/* When we get to the end of a dimension, reset it and increment
the next dimension. */
count[n] = 0;
- rptr -= rs_ex[n];
- sptr -= ss_ex[n];
- hptr -= hs_ex[n];
+ PTR_DECREMENT_BYTES (rptr, rs_ex[n]);
+ PTR_DECREMENT_BYTES (sptr, ss_ex[n]);
+ PTR_DECREMENT_BYTES (hptr, hs_ex[n]);
n++;
if (n >= dim - 1)
{
@@ -182,9 +182,9 @@ cshift1_8_r8 (gfc_array_r8 * const restrict ret,
else
{
count[n]++;
- rptr += rstride[n];
- sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (rptr, rstride[n]);
+ PTR_INCREMENT_BYTES (sptr, sstride[n]);
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c
index 4dd86bf8733e..6d11687fe9bb 100644
--- a/libgfortran/generated/eoshift1_16.c
+++ b/libgfortran/generated/eoshift1_16.c
@@ -139,7 +139,7 @@ eoshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -148,7 +148,7 @@ eoshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -224,7 +224,7 @@ eoshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -234,9 +234,9 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -249,7 +249,7 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c
index 96e73cb7ecc3..9d4e6abeaf1c 100644
--- a/libgfortran/generated/eoshift1_4.c
+++ b/libgfortran/generated/eoshift1_4.c
@@ -139,7 +139,7 @@ eoshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -148,7 +148,7 @@ eoshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -224,7 +224,7 @@ eoshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -234,9 +234,9 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -249,7 +249,7 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c
index 5f62d46e6b32..dff31fc72add 100644
--- a/libgfortran/generated/eoshift1_8.c
+++ b/libgfortran/generated/eoshift1_8.c
@@ -139,7 +139,7 @@ eoshift1 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
n++;
}
}
@@ -148,7 +148,7 @@ eoshift1 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
dim = GFC_DESCRIPTOR_RANK (array);
rstride0 = rstride[0];
@@ -224,7 +224,7 @@ eoshift1 (gfc_array_char * const restrict ret,
/* Advance to the next section. */
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
+ PTR_INCREMENT_BYTES (hptr, hstride0);
count[0]++;
n = 0;
while (count[n] == extent[n])
@@ -234,9 +234,9 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
n++;
if (n >= dim - 1)
{
@@ -249,7 +249,7 @@ eoshift1 (gfc_array_char * const restrict ret,
count[n]++;
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
}
}
}
diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c
index cb533dfbd48d..5b8144e65cf0 100644
--- a/libgfortran/generated/eoshift3_16.c
+++ b/libgfortran/generated/eoshift3_16.c
@@ -143,7 +143,7 @@ eoshift3 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
if (bound)
bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
else
@@ -156,7 +156,7 @@ eoshift3 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
if (bound && bstride[0] == 0)
bstride[0] = size;
@@ -238,9 +238,9 @@ eoshift3 (gfc_array_char * const restrict ret,
}
/* Advance to the next section. */
+ PTR_INCREMENT_BYTES (hptr, hstride0);
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
bptr += bstride0;
count[0]++;
n = 0;
@@ -251,9 +251,9 @@ eoshift3 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
bptr -= bstride[n] * extent[n];
n++;
if (n >= dim - 1)
@@ -265,9 +265,9 @@ eoshift3 (gfc_array_char * const restrict ret,
else
{
count[n]++;
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
bptr += bstride[n];
}
}
diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c
index 084d7d81e636..28d4fa8fb9f0 100644
--- a/libgfortran/generated/eoshift3_4.c
+++ b/libgfortran/generated/eoshift3_4.c
@@ -143,7 +143,7 @@ eoshift3 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
if (bound)
bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
else
@@ -156,7 +156,7 @@ eoshift3 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
if (bound && bstride[0] == 0)
bstride[0] = size;
@@ -238,9 +238,9 @@ eoshift3 (gfc_array_char * const restrict ret,
}
/* Advance to the next section. */
+ PTR_INCREMENT_BYTES (hptr, hstride0);
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
bptr += bstride0;
count[0]++;
n = 0;
@@ -251,9 +251,9 @@ eoshift3 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
bptr -= bstride[n] * extent[n];
n++;
if (n >= dim - 1)
@@ -265,9 +265,9 @@ eoshift3 (gfc_array_char * const restrict ret,
else
{
count[n]++;
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
bptr += bstride[n];
}
}
diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c
index ee1eec8766b8..ec21825295f0 100644
--- a/libgfortran/generated/eoshift3_8.c
+++ b/libgfortran/generated/eoshift3_8.c
@@ -143,7 +143,7 @@ eoshift3 (gfc_array_char * const restrict ret,
rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(h,n);
if (bound)
bstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(bound,n);
else
@@ -156,7 +156,7 @@ eoshift3 (gfc_array_char * const restrict ret,
if (rstride[0] == 0)
rstride[0] = size;
if (hstride[0] == 0)
- hstride[0] = 1;
+ hstride[0] = GFC_DESCRIPTOR_SIZE(h);
if (bound && bstride[0] == 0)
bstride[0] = size;
@@ -238,9 +238,9 @@ eoshift3 (gfc_array_char * const restrict ret,
}
/* Advance to the next section. */
+ PTR_INCREMENT_BYTES (hptr, hstride0);
rptr += rstride0;
sptr += sstride0;
- hptr += hstride0;
bptr += bstride0;
count[0]++;
n = 0;
@@ -251,9 +251,9 @@ eoshift3 (gfc_array_char * const restrict ret,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
+ PTR_DECREMENT_BYTES (hptr, hstride[n] * extent[n]);
rptr -= rstride[n] * extent[n];
sptr -= sstride[n] * extent[n];
- hptr -= hstride[n] * extent[n];
bptr -= bstride[n] * extent[n];
n++;
if (n >= dim - 1)
@@ -265,9 +265,9 @@ eoshift3 (gfc_array_char * const restrict ret,
else
{
count[n]++;
+ PTR_INCREMENT_BYTES (hptr, hstride[n]);
rptr += rstride[n];
sptr += sstride[n];
- hptr += hstride[n];
bptr += bstride[n];
}
}
diff --git a/libgfortran/generated/findloc0_c10.c b/libgfortran/generated/findloc0_c10.c
index 5b5b0e31daef..96098c9db9c4 100644
--- a/libgfortran/generated/findloc0_c10.c
+++ b/libgfortran/generated/findloc0_c10.c
@@ -76,7 +76,7 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_c10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_c10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_c16.c b/libgfortran/generated/findloc0_c16.c
index 83d5c0e46c53..e36a31fc4e3c 100644
--- a/libgfortran/generated/findloc0_c16.c
+++ b/libgfortran/generated/findloc0_c16.c
@@ -76,7 +76,7 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_c16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_c16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_c17.c b/libgfortran/generated/findloc0_c17.c
index cc6205803630..bc5fc511d3a4 100644
--- a/libgfortran/generated/findloc0_c17.c
+++ b/libgfortran/generated/findloc0_c17.c
@@ -76,7 +76,7 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_c17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_c17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_c4.c b/libgfortran/generated/findloc0_c4.c
index 042a0be732fe..6a92135328e0 100644
--- a/libgfortran/generated/findloc0_c4.c
+++ b/libgfortran/generated/findloc0_c4.c
@@ -76,7 +76,7 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_c4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_c4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_c8.c b/libgfortran/generated/findloc0_c8.c
index c928e30613a5..7fffac1b5ca5 100644
--- a/libgfortran/generated/findloc0_c8.c
+++ b/libgfortran/generated/findloc0_c8.c
@@ -76,7 +76,7 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_c8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_c8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_i1.c b/libgfortran/generated/findloc0_i1.c
index f461b1d64449..bed07f91924b 100644
--- a/libgfortran/generated/findloc0_i1.c
+++ b/libgfortran/generated/findloc0_i1.c
@@ -76,7 +76,7 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_i1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_i1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_i16.c b/libgfortran/generated/findloc0_i16.c
index 3daee388de26..53d802c8eda0 100644
--- a/libgfortran/generated/findloc0_i16.c
+++ b/libgfortran/generated/findloc0_i16.c
@@ -76,7 +76,7 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_i16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_i16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_i2.c b/libgfortran/generated/findloc0_i2.c
index 66080fc10ea7..a7ee428ecfd0 100644
--- a/libgfortran/generated/findloc0_i2.c
+++ b/libgfortran/generated/findloc0_i2.c
@@ -76,7 +76,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_i4.c b/libgfortran/generated/findloc0_i4.c
index 9ece6a04f0db..7d3fa831391c 100644
--- a/libgfortran/generated/findloc0_i4.c
+++ b/libgfortran/generated/findloc0_i4.c
@@ -76,7 +76,7 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_i4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_i4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_i8.c b/libgfortran/generated/findloc0_i8.c
index d51818c92c2a..a37bf091c43a 100644
--- a/libgfortran/generated/findloc0_i8.c
+++ b/libgfortran/generated/findloc0_i8.c
@@ -76,7 +76,7 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_i8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_i8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_r10.c b/libgfortran/generated/findloc0_r10.c
index 53014d2cdda2..0a274e2cee64 100644
--- a/libgfortran/generated/findloc0_r10.c
+++ b/libgfortran/generated/findloc0_r10.c
@@ -76,7 +76,7 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_r10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_r10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_r16.c b/libgfortran/generated/findloc0_r16.c
index 4220fb41c5a3..e3ca7605db9a 100644
--- a/libgfortran/generated/findloc0_r16.c
+++ b/libgfortran/generated/findloc0_r16.c
@@ -76,7 +76,7 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_r16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_r16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_r17.c b/libgfortran/generated/findloc0_r17.c
index 5c09579d9087..ef1d8919426f 100644
--- a/libgfortran/generated/findloc0_r17.c
+++ b/libgfortran/generated/findloc0_r17.c
@@ -76,7 +76,7 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_r17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_r17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_r4.c b/libgfortran/generated/findloc0_r4.c
index 4be93e94508a..db5a3ead6975 100644
--- a/libgfortran/generated/findloc0_r4.c
+++ b/libgfortran/generated/findloc0_r4.c
@@ -76,7 +76,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_r4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_r4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_r8.c b/libgfortran/generated/findloc0_r8.c
index e215854c55b0..2314eeb7359d 100644
--- a/libgfortran/generated/findloc0_r8.c
+++ b/libgfortran/generated/findloc0_r8.c
@@ -76,7 +76,7 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -101,7 +101,7 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -112,14 +112,14 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -138,7 +138,7 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -149,14 +149,14 @@ findloc0_r8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -232,7 +232,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -258,7 +258,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -270,7 +270,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -278,7 +278,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -298,7 +298,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -310,7 +310,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -318,7 +318,7 @@ mfindloc0_r8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* 1;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_s1.c b/libgfortran/generated/findloc0_s1.c
index 8a64d306b27c..ba72c39fc528 100644
--- a/libgfortran/generated/findloc0_s1.c
+++ b/libgfortran/generated/findloc0_s1.c
@@ -77,7 +77,7 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -102,7 +102,7 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -113,14 +113,14 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -139,7 +139,7 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -150,14 +150,14 @@ findloc0_s1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -235,7 +235,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -261,7 +261,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -273,7 +273,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -281,7 +281,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -301,7 +301,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -313,7 +313,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -321,7 +321,7 @@ mfindloc0_s1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc0_s4.c b/libgfortran/generated/findloc0_s4.c
index 50b7f673f7e3..b963db3fa16e 100644
--- a/libgfortran/generated/findloc0_s4.c
+++ b/libgfortran/generated/findloc0_s4.c
@@ -77,7 +77,7 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
if (extent[n] <= 0)
@@ -102,7 +102,7 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -113,14 +113,14 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base -= sstride[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -139,7 +139,7 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
} while(++count[0] != extent[0]);
n = 0;
@@ -150,14 +150,14 @@ findloc0_s4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
n++;
if (n >= rank)
return;
else
{
count[n]++;
- base += sstride[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
}
} while (count[n] == extent[n]);
}
@@ -235,7 +235,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
sz = 1;
for (n = 0; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
sz *= extent[n];
@@ -261,7 +261,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
return;
}
- base -= sstride[0] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[0]);
mbase -= mstride[0];
} while(++count[0] != extent[0]);
@@ -273,7 +273,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base += sstride[n] * extent[n] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -281,7 +281,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base -= sstride[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
@@ -301,7 +301,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
return;
}
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
mbase += mstride[0];
} while(++count[0] != extent[0]);
@@ -313,7 +313,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
count[n] = 0;
/* We could precalculate these products, but this is a less
frequently used path so probably not worth it. */
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
n++;
if (n >= rank)
@@ -321,7 +321,7 @@ mfindloc0_s4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n]* len_array;
+ PTR_INCREMENT_BYTES (base, sstride[n]);
mbase += mstride[n];
}
} while (count[n] == extent[n]);
diff --git a/libgfortran/generated/findloc1_c10.c b/libgfortran/generated/findloc1_c10.c
index 5fbd62258731..90bc1c5e86ec 100644
--- a/libgfortran/generated/findloc1_c10.c
+++ b/libgfortran/generated/findloc1_c10.c
@@ -64,11 +64,11 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_COMPLEX_10 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_c10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_COMPLEX_10 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_c10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_c10 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_c10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_c16.c b/libgfortran/generated/findloc1_c16.c
index caff5433572f..3823bbb7c025 100644
--- a/libgfortran/generated/findloc1_c16.c
+++ b/libgfortran/generated/findloc1_c16.c
@@ -64,11 +64,11 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_COMPLEX_16 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_c16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_COMPLEX_16 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_c16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_c17.c b/libgfortran/generated/findloc1_c17.c
index 533e9c623aee..6039412b1d1f 100644
--- a/libgfortran/generated/findloc1_c17.c
+++ b/libgfortran/generated/findloc1_c17.c
@@ -64,11 +64,11 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_COMPLEX_17 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_c17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_COMPLEX_17 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_c17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_c17 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_c17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_c4.c b/libgfortran/generated/findloc1_c4.c
index bf6b8c7f1960..8907721eb429 100644
--- a/libgfortran/generated/findloc1_c4.c
+++ b/libgfortran/generated/findloc1_c4.c
@@ -64,11 +64,11 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_COMPLEX_4 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_c4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_COMPLEX_4 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_c4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_c8.c b/libgfortran/generated/findloc1_c8.c
index aaa9d09df0c6..8d0e2ac568e5 100644
--- a/libgfortran/generated/findloc1_c8.c
+++ b/libgfortran/generated/findloc1_c8.c
@@ -64,11 +64,11 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_COMPLEX_8 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_c8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_COMPLEX_8 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_c8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_i1.c b/libgfortran/generated/findloc1_i1.c
index d5a50ee21afe..56de7e205772 100644
--- a/libgfortran/generated/findloc1_i1.c
+++ b/libgfortran/generated/findloc1_i1.c
@@ -64,11 +64,11 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_INTEGER_1 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_i1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_INTEGER_1 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_i1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_i16.c b/libgfortran/generated/findloc1_i16.c
index 218f11d3fc82..5917ebfc7910 100644
--- a/libgfortran/generated/findloc1_i16.c
+++ b/libgfortran/generated/findloc1_i16.c
@@ -64,11 +64,11 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_INTEGER_16 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_i16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_INTEGER_16 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_i16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_i2.c b/libgfortran/generated/findloc1_i2.c
index afc691f84c19..bec080adf5a8 100644
--- a/libgfortran/generated/findloc1_i2.c
+++ b/libgfortran/generated/findloc1_i2.c
@@ -64,11 +64,11 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_INTEGER_2 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_i2 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_INTEGER_2 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_i2 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_i4.c b/libgfortran/generated/findloc1_i4.c
index e09184198b41..c82c2c86b5b2 100644
--- a/libgfortran/generated/findloc1_i4.c
+++ b/libgfortran/generated/findloc1_i4.c
@@ -64,11 +64,11 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_INTEGER_4 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_i4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_INTEGER_4 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_i4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_i8.c b/libgfortran/generated/findloc1_i8.c
index ab23949eb23b..3c69005935d0 100644
--- a/libgfortran/generated/findloc1_i8.c
+++ b/libgfortran/generated/findloc1_i8.c
@@ -64,11 +64,11 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_INTEGER_8 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_i8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_INTEGER_8 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_i8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_r10.c b/libgfortran/generated/findloc1_r10.c
index 195e656fbcf1..a3db95012cb0 100644
--- a/libgfortran/generated/findloc1_r10.c
+++ b/libgfortran/generated/findloc1_r10.c
@@ -64,11 +64,11 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_REAL_10 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_r10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_REAL_10 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_r10 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_r10 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_r10 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_r16.c b/libgfortran/generated/findloc1_r16.c
index 4beecd583ae3..0c29d3a9582c 100644
--- a/libgfortran/generated/findloc1_r16.c
+++ b/libgfortran/generated/findloc1_r16.c
@@ -64,11 +64,11 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_REAL_16 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_r16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_REAL_16 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_r16 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_r17.c b/libgfortran/generated/findloc1_r17.c
index ead93c21c4cf..2a5711a0fbbd 100644
--- a/libgfortran/generated/findloc1_r17.c
+++ b/libgfortran/generated/findloc1_r17.c
@@ -64,11 +64,11 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_REAL_17 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_r17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_REAL_17 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_r17 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_r17 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_r17 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_r4.c b/libgfortran/generated/findloc1_r4.c
index 146df049ad54..0bb9504951fc 100644
--- a/libgfortran/generated/findloc1_r4.c
+++ b/libgfortran/generated/findloc1_r4.c
@@ -64,11 +64,11 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_REAL_4 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_r4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_REAL_4 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_r4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_r8.c b/libgfortran/generated/findloc1_r8.c
index 48fdc3668cd3..3a24334f66b8 100644
--- a/libgfortran/generated/findloc1_r8.c
+++ b/libgfortran/generated/findloc1_r8.c
@@ -64,11 +64,11 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -76,7 +76,7 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -122,7 +122,7 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -139,39 +139,41 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
- for (n = len; n > 0; n--, src -= delta * 1)
+ src = (const GFC_REAL_8 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * 1)
+ for (n = 1; n <= len; n++)
{
if (*src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -181,8 +183,8 @@ findloc1_r8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -231,7 +233,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -249,7 +251,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -258,7 +260,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -305,7 +307,7 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -323,43 +325,47 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * 1;
+ src = (const GFC_REAL_8 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * 1, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * 1, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && *src == value)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * 1;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * 1;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -369,8 +375,8 @@ mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * 1;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -474,7 +480,7 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -486,12 +492,12 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -501,7 +507,7 @@ sfindloc1_r8 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_s1.c b/libgfortran/generated/findloc1_s1.c
index a41fef8557c8..f6979b9c73dd 100644
--- a/libgfortran/generated/findloc1_s1.c
+++ b/libgfortran/generated/findloc1_s1.c
@@ -66,11 +66,11 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -78,7 +78,7 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -124,7 +124,7 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -141,39 +141,41 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * len_array;
- for (n = len; n > 0; n--, src -= delta * len_array)
+ src = (const GFC_UINTEGER_1 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * len_array)
+ for (n = 1; n <= len; n++)
{
if (compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * len_array;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * len_array;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -183,8 +185,8 @@ findloc1_s1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * len_array;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -233,7 +235,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -251,7 +253,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -260,7 +262,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -307,7 +309,7 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -325,43 +327,47 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * len_array;
+ src = (const GFC_UINTEGER_1 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * len_array, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * len_array, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -371,8 +377,8 @@ mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * len_array;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -476,7 +482,7 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -488,12 +494,12 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -503,7 +509,7 @@ sfindloc1_s1 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc1_s4.c b/libgfortran/generated/findloc1_s4.c
index ce70d146d270..652aa79abbfd 100644
--- a/libgfortran/generated/findloc1_s4.c
+++ b/libgfortran/generated/findloc1_s4.c
@@ -66,11 +66,11 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] < 0)
@@ -78,7 +78,7 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
if (extent[n] < 0)
@@ -124,7 +124,7 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -141,39 +141,41 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * len_array;
- for (n = len; n > 0; n--, src -= delta * len_array)
+ src = (const GFC_UINTEGER_4 * restrict) (((char*) base) + (len - 1) * delta);
+ for (n = len; n > 0; n--)
{
if (compare_string_char4 (len_array, src, len_value, value) == 0)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
}
}
else
{
src = base;
- for (n = 1; n <= len; n++, src += delta * len_array)
+ for (n = 1; n <= len; n++)
{
if (compare_string_char4 (len_array, src, len_value, value) == 0)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
}
}
*dest = result;
count[0]++;
- base += sstride[0] * len_array;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * len_array;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -183,8 +185,8 @@ findloc1_s4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * len_array;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -233,7 +235,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
if (len < 0)
len = 0;
- delta = GFC_DESCRIPTOR_STRIDE(array,dim);
+ delta = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
mdelta = GFC_DESCRIPTOR_STRIDE_BYTES(mask,dim);
mbase = mask->base_addr;
@@ -251,7 +253,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < dim; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,n);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
@@ -260,7 +262,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
}
for (n = dim; n < rank; n++)
{
- sstride[n] = GFC_DESCRIPTOR_STRIDE(array, n + 1);
+ sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array, n + 1);
mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask, n + 1);
extent[n] = GFC_DESCRIPTOR_EXTENT(array, n + 1);
@@ -307,7 +309,7 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -325,43 +327,47 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
result = 0;
if (back)
{
- src = base + (len - 1) * delta * len_array;
+ src = (const GFC_UINTEGER_4 * restrict) (((char*)base) + (len - 1) * delta);
msrc = mbase + (len - 1) * mdelta;
- for (n = len; n > 0; n--, src -= delta * len_array, msrc -= mdelta)
+ for (n = len; n > 0; n--)
{
if (*msrc && compare_string_char4 (len_array, src, len_value, value) == 0)
{
result = n;
break;
}
+ PTR_DECREMENT_BYTES (src, delta);
+ msrc -= mdelta;
}
}
else
{
src = base;
msrc = mbase;
- for (n = 1; n <= len; n++, src += delta * len_array, msrc += mdelta)
+ for (n = 1; n <= len; n++)
{
if (*msrc && compare_string_char4 (len_array, src, len_value, value) == 0)
{
result = n;
break;
}
+ PTR_INCREMENT_BYTES (src, delta);
+ msrc += mdelta;
}
}
*dest = result;
count[0]++;
- base += sstride[0] * len_array;
+ PTR_INCREMENT_BYTES (base, sstride[0]);
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
mbase += mstride[0];
- dest += dstride[0];
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- base -= sstride[n] * extent[n] * len_array;
+ PTR_DECREMENT_BYTES (base, sstride[n] * extent[n]);
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
mbase -= mstride[n] * extent[n];
- dest -= dstride[n] * extent[n];
n++;
if (n >= rank)
{
@@ -371,8 +377,8 @@ mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- base += sstride[n] * len_array;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (base, sstride[n]);
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
@@ -476,7 +482,7 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray,
for (n = 0; n < rank; n++)
{
count[n] = 0;
- dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
+ dstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,n);
if (extent[n] <= 0)
return;
}
@@ -488,12 +494,12 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray,
*dest = 0;
count[0]++;
- dest += dstride[0];
+ PTR_INCREMENT_BYTES (dest, dstride[0]);
n = 0;
while (count[n] == extent[n])
{
count[n] = 0;
- dest -= dstride[n] * extent[n];
+ PTR_DECREMENT_BYTES (dest, dstride[n] * extent[n]);
n++;
if (n >= rank)
{
@@ -503,7 +509,7 @@ sfindloc1_s4 (gfc_array_index_type * const restrict retarray,
else
{
count[n]++;
- dest += dstride[n];
+ PTR_INCREMENT_BYTES (dest, dstride[n]);
}
}
}
diff --git a/libgfortran/generated/findloc2_s1.c b/libgfortran/generated/findloc2_s1.c
index b963ca5e0257..70c49d33295d 100644
--- a/libgfortran/generated/findloc2_s1.c
+++ b/libgfortran/generated/findloc2_s1.c
@@ -45,15 +45,15 @@ findloc2_s1 (gfc_array_s1 * const restrict array, const GFC_UINTEGER_1 * restric
if (extent <= 0)
return 0;
- sstride = GFC_DESCRIPTOR_STRIDE(array,0) * len_array;
+ sstride = GFC_DESCRIPTOR_STRIDE_BYTES(array,0);
if (back)
{
- src = array->base_addr + (extent - 1) * sstride;
+ src = (const GFC_UINTEGER_1 * restrict) (((char*)array->base_addr) + (extent - 1) * sstride);
for (i = extent; i > 0; i--)
{
if (compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
return i;
- src -= sstride;
+ PTR_DECREMENT_BYTES (src, sstride);
}
}
else
@@ -63,7 +63,7 @@ findloc2_s1 (gfc_array_s1 * const restrict array, const GFC_UINTEGER_1 * restric
{
if (compare_string (len_array, (char *) src, len_value, (char *) value) == 0)
return i;
- src += sstride;
+ PTR_INCREMENT_BYTES (src, sstride);
}
}
return 0;
@@ -105,18 +105,18 @@ mfindloc2_s1 (gfc_array_s1 * const restrict array,
else
internal_error (NULL, "Funny sized logical array");
- sstride = GFC_DESCRIPTOR_STRIDE(array,0) * len_array;
+ sstride = GFC_DESCRIPTOR_STRIDE_BYTES(array,0);
mstride = GFC_DESCRIPTOR_STRIDE_BYTES(mask,0);
if (back)
{
- src = array->base_addr + (extent - 1) * sstride;
+ src = (const GFC_UINTEGER_1 * restrict) (((char*)array->base_addr) + (extent - 1) * sstride);
mbase += (extent - 1) * mstride;
for (i = extent; i > 0; i--)
{
if (*mbase && (compare_string (len_array, (char *) src, len_value, (char *) value) == 0))
return i;
- src -= sstride;
+ PTR_DECREMENT_BYTES (src, sstride);
mbase -= mstride;
}
}
diff --git a/libgfortran/generated/findloc2_s4.c b/libgfortran/generated/findloc2_s4.c
index 8e71d6145565..8f8f09660364 100644
--- a/libgfortran/generated/findloc2_s4.c
+++ b/libgfortran/generated/findloc2_s4.c
@@ -45,15 +45,15 @@ findloc2_s4 (gfc_array_s4 * const restrict array, const GFC_UINTEGER_4 * restric
if (extent <= 0)
return 0;
- sstride = GFC_DESCRIPTOR_STRIDE(array,0) * len_array;
+ sstride = GFC_DESCRIPTOR_STRIDE_BYTES(array,0);
if (back)
{
- src = array->base_addr + (extent - 1) * sstride;
+ src = (const GFC_UINTEGER_4 * restrict) (((char*)array->base_addr) + (extent - 1) * sstride);
for (i = extent; i > 0; i--)
{
if (compare_string_char4 (len_array, src, len_value, value) == 0)
return i;
- src -= sstride;
+ PTR_DECREMENT_BYTES[...]
[diff truncated at 524288 bytes]
More information about the Gcc-cvs
mailing list