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: Skip bound conv in gfc_conv_gfc_desc_to_cfi_desc with intent(out) ptr [PR108621]
Date: Fri, 24 Feb 2023 22:25:34 +0100	[thread overview]
Message-ID: <6bad55d7-d508-04af-88c2-8f0ec7e15419@gmx.de> (raw)
In-Reply-To: <07be8524-0755-6b77-49bd-af5c688404d5@codesourcery.com>

Hi Tobias,

Am 24.02.23 um 12:31 schrieb Tobias Burnus:
> (B) The attached patch:
>
> With 'intent(out)' there is no reason to do the conversions. While for
> nullified
> pointers the bounds-conversion loop is skipped, it may still be executed
> for undefined
> pointers. (Which is usually harmless.) In either case, not generating
> this code makes
> sense.
>
> OK for mainline?

LGTM.

I was pondering whether one should keep the testcase closer to the
one in the PR, but the essence of the bug and the fix is well
represented in the reduced version, and also the tree dump tells
the whole story anyway.

> Regarding GCC 12:  I am not really sure as it is no real regression.
> Besides bogus
> warnings, there might be an issue for undefined pointers and
> -fsanitize=undefined, namely
> if 'ubound - lbound' evaluated on random numbers overflows (such as for
> ubound = huge(..)
> and lbound = -huge(..)). But that looks like a rather special case. -
> Thoughts?

I'd rather consider the case of undefined pointers as of practical
importance.  It's up to you or others to decide whether it should
be backported.  I would not oppose.

Thanks for the patch!

Harald

> Tobias
> -----------------
> 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:[~2023-02-24 21:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 11:31 Tobias Burnus
2023-02-24 21:25 ` Harald Anlauf [this message]

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=6bad55d7-d508-04af-88c2-8f0ec7e15419@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).