public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Tobias Burnus <tobias@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	fortran <fortran@gcc.gnu.org>
Subject: Re: [Patch, Fortran] libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]
Date: Tue, 13 Dec 2022 21:53:40 +0100	[thread overview]
Message-ID: <befb2f50-e779-836e-68ec-93a11ed25990@gmx.de> (raw)
In-Reply-To: <a599f6ae-ac6d-7c59-890a-104e4d5e3e1c@codesourcery.com>

Hi Tobias,

Am 13.12.22 um 17:29 schrieb Tobias Burnus:
> This is a 12/13 regression as come changes to fix the GFC/CFI descriptor
> that went into GCC 12 fail with the (bogus) descriptor passed via by a
> GCC-11-compiled program.
>
> As later GCC 12 changes moved the descriptor to the front end, those
> functions are only in libgomp.so to cater for old program. Richard
> suggested in the PR that the best way is to move to the GCC 11 version,
> such that libgfortran.so won't regress.

that appears to be the most reasonable & practical way to go.

> I now did so - except for three fixes (cf. changelog). See also
> PR: https://gcc.gnu.org/PR108056
>
> There is no testcase as it needs to be compiled by GCC <= 11 and then
> run with linking (dynamically) to a GCC 12 or 13 libgfortran.

I've verified that the testcase in the PR does not crash with
the re-modified libgfortran.

I've looked at the resulting ISO_Fortran_binding.c vs. the 11-branch
version and am still trying to understand the resulting differences
in the code, in what respect they might be relevant or not.

Given that this is a somewhat delicate situation we're in, is there
a set of tests that I could run *manually* (i.e. compile with gcc-11
and link with gcc-12/13) to verify that this best-effort fix should
be good enough for the common user?

Just a suggestion of a few "randomly" chosen tests?

> OK for mainline and GCC 12?
>
>   * * *
>
> Note: It is strongly recommended to use GCC 12 (or 13) with
> array-descriptor
> C interop as many issues were fixed. Like for the testcase in the PR; in
> GCC 11
> the type arriving in libgomp is BT_ASSUME ('type(*)'). But as the effective
> argument is passed as array descriptor through out, the 'float'
> (real(4)) type
> info is actually preservable (as GCC 12 cf. testcase of comment 0 and my
> comment
> in the PR for the C part of the testcase).(*)

Well, in the real world there are larger installations with large
software stacks, and it is easier said to "compile each component
with the same compiler version" than done...

(I've just had another personal experience during my daytime job.)

Thanks for your effort so far!

Harald

> Tobias
>
> ((*) This is not possible if using a scalar 'type(*)' or a
> non-array-descriptor
> array in between. I think GCC 12 uses 'CFI_other' in the
> information-is-lost case.)
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,
> 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer:
> Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;
> Registergericht München, HRB 106955


  reply	other threads:[~2022-12-13 20:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 16:29 Tobias Burnus
2022-12-13 20:53 ` Harald Anlauf [this message]
2022-12-13 21:41   ` Tobias Burnus
2022-12-13 22:27     ` Harald Anlauf
2022-12-14  7:57       ` Tobias Burnus
2022-12-14 19:26         ` Harald Anlauf
2022-12-14  8:21 ` Richard Biener

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=befb2f50-e779-836e-68ec-93a11ed25990@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /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).