[PATCH] Do array index calculations in gfc_array_index_type
Kyrill Tkachov
kyrylo.tkachov@foss.arm.com
Mon Sep 24 16:49:00 GMT 2018
Hi all,
On 24/09/18 14:54, Andreas Schwab wrote:
> On Sep 22 2018, Janne Blomqvist <blomqvist.janne@gmail.com> wrote:
>
> > +! { dg-final { scan-tree-dump-times "_gfortran_caf_lock \\(four.token, .*\\(1 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(7 - four.dim\\\[1\\\].lbound\\), &acquired.\[0-9\]+, &ii, 0B, 0\\);|_gfortran_caf_lock \\(four.token, 1 - four.dim\\\[0\\\].lbound, 7 - four.dim\\\[1\\\].lbound, &acquired.\[0-9\]+, &ii, 0B, 0\\);" 1 "original" } }
> > +! { dg-final { scan-tree-dump-times "_gfortran_caf_unlock \\(four.token, .*\\(2 - four.dim\\\[0\\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(8 - four.dim\\\[1\\\].lbound\\), 0B, 0B, 0\\);|_gfortran_caf_unlock \\(four.token, 2 - four.dim\\\[0\\\].lbound, 8 - four.dim\\\[1\\\].lbound, 0B, 0B, 0\\);" 1 "original" } }
>
> This is wrong for ILP32.
>
To be more concrete, this FAILs on arm-none-linux-gnueabihf:
FAIL: gfortran.dg/coarray_lock_7.f90 -O scan-tree-dump-times original "_gfortran_caf_lock \\(four.token, .*\\(1 - four.dim\\[0\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(7 - four.dim\\[1\\].lbound\\), &acquired.[0-9]+, &ii, 0B, 0\\);|_gfortran_caf_lock \\(four.token, 1 - four.dim\\[0\\].lbound, 7 - four.dim\\[1\\].lbound, &acquired.[0-9]+, &ii, 0B, 0\\);" 1
FAIL: gfortran.dg/coarray_lock_7.f90 -O scan-tree-dump-times original "_gfortran_caf_unlock \\(four.token, .*\\(2 - four.dim\\[0\\].lbound\\), \\(integer\\(kind=4\\)\\) \\(8 - four.dim\\[1\\].lbound\\), 0B, 0B, 0\\);|_gfortran_caf_unlock \\(four.token, 2 - four.dim\\[0\\].lbound, 8 - four.dim\\[1\\].lbound, 0B, 0B, 0\\);" 1
Thanks,
Kyrill
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
More information about the Fortran
mailing list