[PATCH 00/18] Fortran compiler identification and ifx testsuite support
Nils-Christian Kempke
nils-christian.kempke@intel.com
Tue May 10 14:24:19 GMT 2022
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
More information about the Gdb-patches
mailing list