From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id B280A383678D for ; Wed, 14 Dec 2022 15:34:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B280A383678D Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 3D1BE280B14; Wed, 14 Dec 2022 16:34:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1671032094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ohpry2AOafIb1qCuSy5Kifo5UqP/PeFXxd7XwyurAe8=; b=ctnIepEUdw1mpYi9JlAbM6zuewiyRacSiZjpbbZT9qYASHB0bTGC6BlHY6pCY/bpywtnRX Onqy4LjtTIxt1f3ezmLViMeup/57HrG2TrCUVCd1Hmb3bit0xeUqdwXIl3SZfORbjqikpi 2ESWAuFeadyuteZoxisj7WaGJzjUbdk= Date: Wed, 14 Dec 2022 16:34:54 +0100 From: Jan Hubicka To: Martin Jambor Cc: GCC Patches Subject: Re: [PATCH] ipa-sra: Fix address escape case when detecting Fortran descriptors Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Hi, > > The discussion about scan_expr_access in ipa-sra.cc brought my > attention to a missing case of handling an ADDR_EXPR. As the added > testcase shows, the heuristics which looks for parameters which are > local variables that are only written to and passed by reference in > calls can miss a case where the address of the variable in question is > stored elsewhere in an assignment. > > This patch adds that case to the function and also adds the > optimization that Richi suggested, i.e. bailing out early on simple > SSA_NAMEs and constant trees. > > The patch is undergoing bootstrap and testing on an x86_64-linux right > now. OK if it passes? > > Thanks, > > Martin > > > gcc/ChangeLog: > > 2022-12-14 Martin Jambor > > * ipa-sra.cc (loaded_decls): Adjust comment. > (scan_expr_access): Also detect assignments of address of local > variables to a variable. Bail out early on SSA_NAMEs and > constants as an optimization. > > gcc/testsuite/ChangeLog: > > 2022-12-14 Martin Jambor > > * gcc.dg/ipa/ipa-sra-29.c: New test. OK, Thanks! Honza