public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/18] Fortran compiler identification and ifx testsuite support
@ 2022-05-10 14:24 Nils-Christian Kempke
  2022-05-10 14:24 ` [PATCH 01/18] gdb/testsuite: remove F77_FOR_TARGET support Nils-Christian Kempke
                   ` (18 more replies)
  0 siblings, 19 replies; 39+ messages in thread
From: Nils-Christian Kempke @ 2022-05-10 14:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess, JiniSusan.George, Nils-Christian Kempke

Hi all,

this series is a collection of patches we have prepared that was
targeted at improving the overall passrate of the Intel ifx compiler
within the Fortran testsuite.  It also includes a new way for the
testsuite to identify the Fortran compilers and their version.


There are a few places in the gdb.fortran part of the testsuite that
needed to be adapted for ifx.  Some of these changes make the
testsuite a bit less taylored to the gfortran specifics.  Some of the
changes fix flags and such to better support running the testsuite
with ifx.

While doing this and after initially submitting a patch here

https://sourceware.org/pipermail/gdb-patches/2021-December/184612.html

and in the follow-up discussion here

https://sourceware.org/pipermail/gdb-patches/2022-January/185064.html

we decided to change the testsuite a bit more and add a Frotran specific
compiler identification to the Fortran testsuite.

Generally, the procedures test_compiler_info and get_compiler_info are
used in the testsuite to detect a certain compiler (e.g. gcc-*).  This
info is then used to set certain flags/kfails etc.

The procedure get_compiler_info would, upon calling it, take the files
compiler.c/compiler.cc (depending on wether or not the c++ option was
passed to them) and run them through the respective C/CXX preprocessors
of the compiler given via CC_FOR_TARGET/CXX_FOR_TARGET (or gcc/gfortran
if these were not set).  It would detect compiler specific macro
definitions and retrun the compiler used, as well as its version in a
string.  As there was no separate option available for Fortran, using
get_compiler_info inside a Fortran test would always default to the C
compiler detection and return the version and name of the C compiler
defined in CC_FOR_TARGET (or gcc if none was set).

This meant, that running the testsuite while defining a F90_FOR_TARGET
would, in order to set the right flags and kfails within the testsuite
run, require one to also set the CC_FOR_TARGET to the C compiler that
would 'correspond' to the Fortran one.  So F90_FOR_TARGET=ifx would
require CC_FOR_TARGET=icx, flang would require clang and so on.
Running the Fortran testsuite with only F90_FOR_TARGET=ifx would be the
equivalent of setting CC_FOR_TARGET=gcc.  The test_compiler_info would
return gcc-* in this case and compiler specific settings not be applied.
Especially, this made it impossible to run heterogenous combinations of
C and Fortran compilers and still have all flags/kfails setup correctly.

In order to improve this (and the rest of our patches are base on this)
we added a new option to get/test_compiler_info: 'f90'.  We added a
Fortran compiler identification mechanism similar to the existing C/CXX
ones by adding the file compiler.F90.  Similar to C/CXX, the Fortran
compiler detection preprocesses the compiler.F90 file and, depending on
the macros defined by the compiler, will return the Fortran compiler
name and version.

We want to note here, that preprocessing is not part of the Fortran
standard.  It was used here as it seems to be common for most compilers
to have this feature in place (in fact, we don't know of any modern
Fortran compilers that don't have it).

We added detection for gfortran, ifx, ifort, classic flang, llvm flang,
and armflang.  While we tested the detection for all compilers with
their latest available versions, we could not test the armflang compiler
identification.  We would kindly ask someone from arm (and I'll cc
someone in this patch who I've written mails with before) to test these
detection changes for us.  They were extracted from the latest online
armflang documentation.

At last, when adding the Fortran compiler identification we were faced
with the problem of properly maintaining F77_FOR_TARGET.  We think, this
feature is not maintained anymore and the last usage of it was removed
many years ago.  Thus, we decided to remove F77_FOR_TARGET from the
testsuite.

All these changes were tested for regressions on a x86_64 Ubunut20.04
machine running the boards unix, unix/-m32, native-gdbserver, and
native-extended-gdbserver (-m32 is acually only properly supported for
gfortran and ifort as far as we know).

This series did not show any regressions but imporves the testsuite
support for ifx significantly (in some places also for ifort and flang).

We're looking forward to feedback!

Cheers,

Nils

Abdul Basit Ijaz (1):
  gdb/testsuite: Use -module option for Intel Fortran compilers

Cristian Sandu (1):
  gdb/testsuite: add Fortran compiler identification to GDB

Felix Willgerodt (1):
  gdb/testsuite: Fix fortran types for Intel compilers.

Nils-Christian Kempke (15):
  gdb/testsuite: remove F77_FOR_TARGET support
  gdb/testsuite: add local variable for passing 'getting_compiler_info'
    to gdb_compile
  gdb/testsuite: rename intel next gen c/cpp compilers
  gdb/testsuite: disable charset.exp for intel compilers
  testsuite, fortran: make print-formatted.exp more robust
  testsuite, fortran: add required external keyword
  testsuite, fortran: add compiler dependent types to
    dynamic-ptype-whatis
  testsuite, fortran: Add '-debug-parameters all' when compiling with
    ifx
  testsuite/lib: add check_optional_entry for GDBInfoSymbols
  testsuite, fortran: fix info-types for intel compilers
  testsuite, fortran: Add type info of formal parameter for Intel
    compilers.
  testsuite, fortran: allow additional completions in module.exp
  gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp
  gdb, testsuite, fortran: fixup mixed-lang-stack for Intel/LLVM
    compilers
  gdb/testsuite: fixup common-block.exp for intel compilers

 gdb/testsuite/boards/cc-with-tweaks.exp       |   5 -
 gdb/testsuite/boards/debug-types.exp          |   1 -
 gdb/testsuite/boards/gold-gdb-index.exp       |   1 -
 gdb/testsuite/gdb.fortran/assumedrank.exp     |   6 +-
 gdb/testsuite/gdb.fortran/charset.exp         |   5 +
 .../gdb.fortran/class-allocatable-array.exp   |   4 +-
 gdb/testsuite/gdb.fortran/common-block.exp    |  38 ++++++-
 .../gdb.fortran/derived-type-striding.exp     |   2 +-
 .../gdb.fortran/dynamic-ptype-whatis.exp      |  79 +++++++-------
 gdb/testsuite/gdb.fortran/function-calls.f90  |   1 +
 gdb/testsuite/gdb.fortran/info-types.exp      |  10 +-
 gdb/testsuite/gdb.fortran/library-module.exp  |   2 +-
 .../gdb.fortran/mixed-lang-stack.cpp          |  12 +--
 .../gdb.fortran/mixed-lang-stack.exp          |  21 ++--
 gdb/testsuite/gdb.fortran/module.exp          |   5 +-
 gdb/testsuite/gdb.fortran/namelist.exp        |   2 +-
 gdb/testsuite/gdb.fortran/nested-funcs-2.exp  |   3 +-
 gdb/testsuite/gdb.fortran/print-formatted.exp |   3 +-
 gdb/testsuite/gdb.fortran/print-formatted.f90 |   1 +
 .../gdb.fortran/ptype-on-functions.exp        |  12 ++-
 gdb/testsuite/gdb.fortran/vla-type.exp        |   2 +-
 gdb/testsuite/lib/compiler.F90                |  69 ++++++++++++
 gdb/testsuite/lib/compiler.c                  |   2 +-
 gdb/testsuite/lib/compiler.cc                 |   2 +-
 gdb/testsuite/lib/fortran.exp                 | 100 +++++++++++-------
 gdb/testsuite/lib/future.exp                  |  21 +---
 gdb/testsuite/lib/gdb.exp                     |  61 +++++++----
 gdb/testsuite/lib/sym-info-cmds.exp           |  18 +++-
 28 files changed, 317 insertions(+), 171 deletions(-)
 create mode 100644 gdb/testsuite/lib/compiler.F90

-- 
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] 39+ messages in thread

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

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 14:24 [PATCH 00/18] Fortran compiler identification and ifx testsuite support Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 01/18] gdb/testsuite: remove F77_FOR_TARGET support Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 02/18] gdb/testsuite: Use -module option for Intel Fortran compilers Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 03/18] gdb/testsuite: Fix fortran types for Intel compilers Nils-Christian Kempke
2022-05-11  9:49   ` Andrew Burgess
2022-05-11  9:57     ` Kempke, Nils-Christian
2022-05-10 14:24 ` [PATCH 04/18] gdb/testsuite: add local variable for passing 'getting_compiler_info' to gdb_compile Nils-Christian Kempke
2022-05-11 10:10   ` Andrew Burgess
2022-05-11 14:24     ` Kempke, Nils-Christian
2022-05-10 14:24 ` [PATCH 05/18] gdb/testsuite: add Fortran compiler identification to GDB Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 06/18] gdb/testsuite: rename intel next gen c/cpp compilers Nils-Christian Kempke
2022-05-11 11:23   ` Andrew Burgess
2022-05-11 14:28     ` Kempke, Nils-Christian
2022-05-10 14:24 ` [PATCH 07/18] gdb/testsuite: disable charset.exp for intel compilers Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 08/18] testsuite, fortran: make print-formatted.exp more robust Nils-Christian Kempke
2022-05-11 11:32   ` Andrew Burgess
2022-05-11 14:32     ` Kempke, Nils-Christian
2022-05-10 14:24 ` [PATCH 09/18] testsuite, fortran: add required external keyword Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 10/18] testsuite, fortran: add compiler dependent types to dynamic-ptype-whatis Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 11/18] testsuite, fortran: Add '-debug-parameters all' when compiling with ifx Nils-Christian Kempke
2022-05-11 11:56   ` Andrew Burgess
2022-05-11 14:36     ` Kempke, Nils-Christian
2022-05-10 14:24 ` [PATCH 12/18] testsuite/lib: add check_optional_entry for GDBInfoSymbols Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 13/18] testsuite, fortran: fix info-types for intel compilers Nils-Christian Kempke
2022-05-11 12:06   ` Andrew Burgess
2022-05-11 15:20     ` Kempke, Nils-Christian
2022-05-11 16:43       ` Kempke, Nils-Christian
2022-05-30 10:33         ` Andrew Burgess
2022-05-30 10:32       ` Andrew Burgess
2022-05-10 14:24 ` [PATCH 14/18] testsuite, fortran: Add type info of formal parameter for Intel compilers Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 15/18] testsuite, fortran: allow additional completions in module.exp Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 16/18] gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 17/18] gdb, testsuite, fortran: fixup mixed-lang-stack for Intel/LLVM compilers Nils-Christian Kempke
2022-05-10 14:24 ` [PATCH 18/18] gdb/testsuite: fixup common-block.exp for intel compilers Nils-Christian Kempke
2022-05-11 13:29   ` Andrew Burgess
2022-05-11 15:31     ` Kempke, Nils-Christian
2022-05-16  6:36       ` George, Jini Susan
2022-05-16  7:59         ` Kempke, Nils-Christian
2022-05-11 13:32 ` [PATCH 00/18] Fortran compiler identification and ifx testsuite support Andrew Burgess

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).