gcc/libgfortran
Sandra Loosemore b4a9bc7856 Bind(c): Fix bugs in CFI_section
CFI_section was incorrectly adjusting the base pointer for the result
array twice in different ways.  It was also overwriting the array
dimension info in the result descriptor before computing the base
address offset from the source descriptor, which caused problems if
the two descriptors are the same.  This patch fixes both problems and
makes the code simpler, too.

A consequence of this patch is that the result array is now 0-based in
all dimensions instead of starting at the numbering to match the first
element of the source array.  The Fortran standard only specifies the
shape of the result array, not its lower bounds, so this is permitted
and probably less confusing for users as well as implementors.

2021-07-17  Sandra Loosemore  <sandra@codesourcery.com>

	PR libfortran/101310

libgfortran/
	* runtime/ISO_Fortran_binding.c (CFI_section): Fix the base
	address computation and simplify the code.

gcc/testsuite/
	* gfortran.dg/ISO_Fortran_binding_1.c (section_c): Remove
	incorrect assertions.
2021-07-27 21:24:25 -07:00
..
caf Steve Kargl <kargl@gcc.gnu.org> 2021-05-22 13:27:42 +02:00
config Update copyright years. 2021-01-04 10:26:59 +01:00
generated PR libfortran/99218 - matmul on temporary array accesses invalid memory 2021-03-05 20:58:51 +01:00
ieee libgfortran: Fix PR95647 by changing the interfaces of operators .eq. and .ne. 2021-02-12 07:58:16 -08:00
intrinsics Fix "tailing" typo. 2021-06-08 09:42:18 +02:00
io Fix "tailing" typo. 2021-06-08 09:42:18 +02:00
m4 PR libfortran/99218 - matmul on temporary array accesses invalid memory 2021-03-05 20:58:51 +01:00
runtime Bind(c): Fix bugs in CFI_section 2021-07-27 21:24:25 -07:00
acinclude.m4
aclocal.m4
c99_protos.h Update copyright years. 2021-01-04 10:26:59 +01:00
ChangeLog Daily bump. 2021-07-27 00:16:27 +00:00
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020 Rotate ChangeLog files - part 1 - add ChangeLog-2020. 2021-01-01 17:27:52 +01:00
config.h.in
configure Fortran: Re-enable 128-bit integers for AMD GCN 2021-06-29 08:19:56 -07:00
configure.ac Fortran: Re-enable 128-bit integers for AMD GCN 2021-06-29 08:19:56 -07:00
configure.host
gfortran.map Steve Kargl <kargl@gcc.gnu.org> 2021-05-22 13:27:42 +02:00
ISO_Fortran_binding-1-tmpl.h Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
ISO_Fortran_binding-2-tmpl.h Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
ISO_Fortran_binding-3-tmpl.h Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
kinds-override.h Update copyright years. 2021-01-04 10:26:59 +01:00
libgfortran.h Fortran: Fix some issues with pointers to character. 2021-06-05 11:12:50 +00:00
libgfortran.spec.in
libtool-version
Makefile.am Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
Makefile.in Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
mk-kinds-h.sh Bind(C): Fix type encodings in ISO_Fortran_binding.h 2021-07-27 21:20:21 -07:00
mk-sik-inc.sh libgfortran: Skip integer-kind=16 check for amdgcn 2020-07-26 07:20:24 +02:00
mk-srk-inc.sh libgfortran: Skip integer-kind=16 check for amdgcn 2020-07-26 07:20:24 +02:00