public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Nils-Christian Kempke <nils-christian.kempke@intel.com>
To: gdb-patches@sourceware.org
Cc: aburgess@redhat.com, JiniSusan.George@amd.com, tdevries@suse.de,
	Nils-Christian Kempke <nils-christian.kempke@intel.com>
Subject: [PATCH 0/2] Fix regressions introduced by Fortran compiler identification series
Date: Fri,  3 Jun 2022 10:54:12 +0200	[thread overview]
Message-ID: <20220603085414.2391706-1-nils-christian.kempke@intel.com> (raw)

After pushing a series that introduced a separate Fortran compiler
identification mechanism to the testsuite

https://sourceware.org/pipermail/gdb-patches/2022-May/189604.html

Regressions were found as noted here

https://sourceware.org/pipermail/gdb-patches/2022-May/189673.html

and here

https://sourceware.org/pipermail/gdb-patches/2022-June/189679.html

The first email noted, that running the whole testsuite would cause
regressions.  Likely due to the caching of the compiler info throughout
the testsuite.

When running the whole testsuite the fist call to get_compiler_info or
test_compiler_info would set the global compiler_info variable.  Every
subsequent call to get/test_compiler_info would simply check wether
compiler_info had already been set and, if so, omit running the actual
compiler identification and return compiler_info instead.

I changed this behavior to now have several cache variables, one for
each language that can be passed to get/_test_compiler_info (which
would be the default C, Cpp and Fortran).

I could only reporduce the regressions by running

  make check

without any parallelism in the testsuite folder.  Running with any amount
of thread via

  make ckeck -jN

where N could even be 1 in my tests (if I did not make some kind of
mistake here).  I still feel like running make check with any kindo of
parallelism run every single testcase individually (likely distributed
to the available threads).

Either way, after this patch the regressions I could reproduce with make
check are gone and testsuite performance should be ok again.

As to the second part of these regressions: I noticed that after running
`make check` with failing gdb.fortran test additional `.mod` files were
created in the gdb/testsuite directory.  I think these ended up there
for the same reason we saw the regressions.  In gdb.exp the `-J` option
is set for the executable whenever compiling with gfortran - it indicates
the target directory for the compiled module files gfortran generates (or
read in if they are already compiled).  As the compiler was firstly
identified as `gcc..` this parameter was not set when compiling the
Fortran test and, as a result, all mod files ended up in the current
working directory.  This did not seem to have any effect on the first
run.  However, any subsequent run of the testsuite would now show this
fail (even when running gdb.fortran/info-types.exp individually):

  gdb compile failed, /.../gdb//testsuite/gdb.fortran/info-types.f90:47:14:

     47 |   type (m1t1) :: var_b
        |              1
  Error: Derived type 'm1t1' at (1) is being used before it is defined
  /.../gdb/testsuite/gdb.fortran/info-types.f90:50:9:

     50 |   var_b%b = 2
        |         1
    Error: Symbol 'var_b' at (1) has no IMPLICIT type

additonal fails, as compiling the executables would attempt to use these
`.mod` already in the directory.  The m1t1 type is declared in a module
called `mod1`, which also is being used in the failed tests
nested-funcs.exp and module.exp.  For the last two, mod1 actually looks
the exact same - only the version for info-types.exp differs.  The mod1
file in the directory (for me at least) was created by the latter 2 - so
while the latter 2 tests would pass, the info-types.exp could not as
`mod1.mod` does not contain the necessary definitions.

This error should not happen anymore after this series as the original
problems with caching the compiler name should have been eliminated.
Another solution here would be to simply delete the `.mod` file in the
testsuite directory.

Cheers,

Nils


Nils-Christian Kempke (2):
  gdb/testsuite: use test_compiler_info in gcc_major_version
  gdb/testsuite: cache compiler_info on a per language basis

 gdb/testsuite/lib/compiler.F90 | 14 ++++----
 gdb/testsuite/lib/compiler.c   | 18 +++++-----
 gdb/testsuite/lib/compiler.cc  | 18 +++++-----
 gdb/testsuite/lib/gdb.exp      | 66 +++++++++++++++++++++++++++-------
 4 files changed, 78 insertions(+), 38 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


             reply	other threads:[~2022-06-03  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  8:54 Nils-Christian Kempke [this message]
2022-06-03  8:54 ` [PATCH 1/2] gdb/testsuite: use test_compiler_info in gcc_major_version Nils-Christian Kempke
2022-06-03  8:54 ` [PATCH 2/2] gdb/testsuite: cache compiler_info on a per language basis Nils-Christian Kempke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603085414.2391706-1-nils-christian.kempke@intel.com \
    --to=nils-christian.kempke@intel.com \
    --cc=JiniSusan.George@amd.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).