public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/1][PR fortran/29053&29054] Fix regressions in GDB intrinsic handling
@ 2022-04-22 10:52 Nils-Christian Kempke
  2022-04-22 10:52 ` [PATCH 1/1][PR fortran/29053&29054] gdb/testsuite: fix testsuite regressions for unix/-m32 board Nils-Christian Kempke
  0 siblings, 1 reply; 4+ messages in thread
From: Nils-Christian Kempke @ 2022-04-22 10:52 UTC (permalink / raw)
  To: gdb-patches

The patch submitted here

  https://sourceware.org/pipermail/gdb-patches/2022-April/187649.html

introduced regressions in the testsuite when running the unix/-m32
board, as described here

  https://sourceware.org/pipermail/gdb-patches/2022-April/187807.html

and in the GDB bugzilla entries

  https://sourceware.org/bugzilla/show_bug.cgi?id=29053

and

  https://sourceware.org/bugzilla/show_bug.cgi?id=29054

Thanks to Tom for spotting these - I am not sure how they slipped
through..

The reason for the failures however was, that the affected tests tried
to allocate Fortran arrays of sizes/dimensions bigger than 4 byte signed
integers, even when on 32 bit machines.

This lead to either compiler errors, as described in 29054, where an
array of size bigger than the max signed 4 byte integer was being
allocated which got caught by gfortran.  Or, as described in 29053, this
resulted in unexpected behavior of intrinsic functions called on arrays,
where the size itself was small enough to fit into a 4 byte signed
integer but instead the dimensions were outside of these limits.

For fixing this we saw ourselves presented with two options - either
remove the overflow test for 4 byte integer overflow or keep them and
fix them.

We for now decided to keep them and fixed the tests instead.  The given
patch does this in two ways.  First, a compile time detection for 32 bit
systems was necessary, in order to not allocate arrays with critical
dimensions/sizes when on 32 bit machines.  This was done using the
intrinsic module ISO_C_BINDING and from there C_NULL_PTR (Fortran 2003)
and C_SIZEOF (Fortran 2008).  We here check the size of a C pointer at
runtime to determine the system we are on.

Second, the lbound-ubound.exp file itself was adapted.  When running on a
32 bit target some of the test were disabled.

The tests compile and run with gcc/gfortran and icx/ifx.  They compile
but trigger some unrelated FAILS with icc/ifort where we are not sure
when these can be resolved.

The changes were tested for gcc/gfortran on unix/-32, unix,
native-remote, and native-extended-remote (the last two more out of
habit).  As icx/ifx does not support 32 bit currently only the other
three boards were run here.

Thanks,

Nils

Nils-Christian Kempke (1):
  gdb/testsuite: fix testsuite regressions for unix/-m32 board

 gdb/testsuite/gdb.fortran/lbound-ubound.F90 | 39 ++++++++++++---
 gdb/testsuite/gdb.fortran/lbound-ubound.exp | 13 +++--
 gdb/testsuite/gdb.fortran/size.f90          | 55 ++++++++++++++++-----
 3 files changed, 86 insertions(+), 21 deletions(-)

-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-10 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22 10:52 [PATCH 0/1][PR fortran/29053&29054] Fix regressions in GDB intrinsic handling Nils-Christian Kempke
2022-04-22 10:52 ` [PATCH 1/1][PR fortran/29053&29054] gdb/testsuite: fix testsuite regressions for unix/-m32 board Nils-Christian Kempke
2022-05-05  6:26   ` Tom de Vries
2022-05-10 12:52     ` Kempke, Nils-Christian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).