public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Martin Jambor <mjambor@suse.cz>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] tree-sra: Avoid returns of references to SRA candidates
Date: Tue, 28 Nov 2023 18:30:40 +0100	[thread overview]
Message-ID: <8A9F6C88-8342-4D89-A08F-5D5D29D472DD@suse.de> (raw)
In-Reply-To: <ZWYcWAzFUXRtMLvS@kam.mff.cuni.cz>



> Am 28.11.2023 um 17:59 schrieb Jan Hubicka <hubicka@ucw.cz>:
> 
> 
>> 
>>> On Tue, 28 Nov 2023, Martin Jambor wrote:
>>> 
>>> On Tue, Nov 28 2023, Richard Biener wrote:
>>>> On Mon, 27 Nov 2023, Martin Jambor wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> The enhancement to address PR 109849 contained an importsnt thinko,
>>>>> and that any reference that is passed to a function and does not
>>>>> escape, must also not happen to be aliased by the return value of the
>>>>> function.  This has quickly transpired as bugs PR 112711 and PR
>>>>> 112721.
>>>>> 
>>>>> Just as IPA-modref does a good enough job to allow us to rely on the
>>>>> escaped set of variables, it sems to be doing well also on updating
>>>>> EAF_NOT_RETURNED_DIRECTLY call argument flag which happens to address
>>>>> exactly the situation we need to avoid.  Of course, if a call
>>>>> statement ignores any returned value, we also do not need to check the
>>>>> flag.
>>>> 
>>>> But what about EAF_NOT_RETURNED_INDIRECTLY?  Don't you need to
>>>> verify the parameter doesn't escape through the return at all?
>>>> 
>>> 
>>> I thought EAF_NOT_RETURNED_INDIRECTLY prohibits things like "return
>>> param->next" but those are not a problem (whatever next points to cannot
>>> be an SRA candidate and any ADDR_EXPR storing its address there would
>>> trigger a disqualification or at least an assert).  But I guess I am
>>> wrong, what is actually the exact meaning of the flag?
>> 
>> I thought it's return (x.ptr = param, &x);
>> 
>> so the parameter is reachable from the return value.
>> 
>> But let's Honza answer...
> It is same difference as direct/indirect escape. so it check whether
> values pointed to by arg can be possibly returned.  Indeed maybe we
> should think of better name - the other interpretation did not even
> occur to me, but it makes sense.

So does the directly returned flag cover my interpretation of indirect or is there a hole?

Richard 

> Honza
>> 
>> Richard.

  reply	other threads:[~2023-11-28 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 18:16 Martin Jambor
2023-11-28  8:05 ` Richard Biener
2023-11-28 16:16   ` Martin Jambor
2023-11-28 16:33     ` Richard Biener
2023-11-28 16:59       ` Jan Hubicka
2023-11-28 17:30         ` Richard Biener [this message]
2023-11-28 17:38           ` Jan Hubicka
2023-11-28 18:35             ` Richard Biener
2023-11-29 12:04         ` Martin Jambor
2023-11-29 12:18           ` Jan Hubicka
     [not found] <6564dd10.050a0220.70a2b.e9d6SMTPIN_ADDED_BROKEN@mx.google.com>
2023-11-27 18:20 ` Andrew Pinski

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=8A9F6C88-8342-4D89-A08F-5D5D29D472DD@suse.de \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=mjambor@suse.cz \
    /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).