gcc/libgfortran/runtime
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
..
backtrace.c Update copyright years. 2021-01-04 10:26:59 +01:00
bounds.c Update copyright years. 2021-01-04 10:26:59 +01:00
compile_options.c Update copyright years. 2021-01-04 10:26:59 +01:00
convert_char.c Update copyright years. 2021-01-04 10:26:59 +01:00
environ.c Update copyright years. 2021-01-04 10:26:59 +01:00
error.c Update copyright years. 2021-01-04 10:26:59 +01:00
fpu.c Update copyright years. 2021-01-04 10:26:59 +01:00
in_pack_generic.c Update copyright years. 2021-01-04 10:26:59 +01:00
in_unpack_generic.c Update copyright years. 2021-01-04 10:26:59 +01:00
ISO_Fortran_binding.c Bind(c): Fix bugs in CFI_section 2021-07-27 21:24:25 -07:00
main.c Update copyright years. 2021-01-04 10:26:59 +01:00
memory.c Update copyright years. 2021-01-04 10:26:59 +01:00
minimal.c Update copyright years. 2021-01-04 10:26:59 +01:00
pause.c Update copyright years. 2021-01-04 10:26:59 +01:00
select_inc.c Update copyright years. 2021-01-04 10:26:59 +01:00
select.c Update copyright years. 2021-01-04 10:26:59 +01:00
stop.c Update copyright years. 2021-01-04 10:26:59 +01:00
string.c libgfortran: Fix negation for largest integer [PR81986] 2021-03-03 08:07:16 +01:00