From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 7056C3858C54 for ; Tue, 28 Nov 2023 16:33:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7056C3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7056C3858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701189184; cv=none; b=mVEO3oE0Ekzp9ij47SWow5r++kGuUh82qtjO+4aSh5G9+Dt7gNyM6iv/tNj8ZACkDEsuBy0shURVW+mbm9l5Bz50SfurRe3g0XaMrnYjKbFa60y+GNyplBM02/cLQrN2CjAoMTk3ttS/Bx2XIzf/RWOVXKOoK4hKb9C5hbUWW8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701189184; c=relaxed/simple; bh=Eze9kePEw1obpp2V9P/MBBJbA/ymp+5+8vsthCzCy8Y=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=otzPpRwnbZDWOj1zY0anvIY81001qWEvyoKjVfLfCM5+7OOoQ4ceoAaCkbQTz+n50q3qZ4QboPRcXeRa4XGx2wjI6FnnJYHDMQVivb1QjtPoCmEUZ8GjHzmAXTzcd1KZkBHgZqrJyWGUt+wK/NuTWunW3LdxZocVtHnT2uuaqSk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4443E1F899; Tue, 28 Nov 2023 16:33:02 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8008E2C15A; Tue, 28 Nov 2023 16:33:00 +0000 (UTC) Date: Tue, 28 Nov 2023 16:33:00 +0000 (UTC) From: Richard Biener To: Martin Jambor cc: GCC Patches , Jan Hubicka Subject: Re: [PATCH] tree-sra: Avoid returns of references to SRA candidates In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Level: X-Rspamd-Server: rspamd1 Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Queue-Id: 4443E1F899 X-Spam-Score: -4.00 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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... Richard.