From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 935E03858C78 for ; Tue, 12 Dec 2023 17:17:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 935E03858C78 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 935E03858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702401438; cv=none; b=RSLLFIytVsetZzc1maQhqBdSzrSsPBrPOhapF8MvWikYYgz5yp67KVT04z2/M/fdkJSNw3OzjpADV1GwOm2y+MpDst5GtBO3L7LRZ6GrSY3NQ9d+u6VgXIvypnpjVv3PZeqUfhwAFmK8vB4hp0hXn80gkYIjY7ArgOEJAzqGW54= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702401438; c=relaxed/simple; bh=Qeoptl/8yS4Tbjjqpy3BNX1jeo9lKI2WBSLeHpmq12Y=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: Mime-Version:Subject:Date:Message-Id:To; b=dTOUw3z/sYGJqFgthpUarrzv3kbCksV86oiE95Yz5OIVND3aiYDvCAzamXx8HLW6q8EU+bp4bSqu1IVl5VMwuPDNwO91wI6KmNiS9Lz2+y22iIhF+LbeA//hA7gmrZnHJf/Tvek1z3AVluhinITAiauZqIkVmFZmkt4wQJ11SEw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5AA2A224DD; Tue, 12 Dec 2023 17:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702401436; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wGrwMn3JfvC8zxKlLnFKnxwP23z5yDH5T2HTwYNWebU=; b=NebMt7YeVmCFr96OjrFTrzjDrvLyAq7UqhsLojCpI8+EwzRzw+EpBZG2gQ0MsbMRMtMhcJ 1EoIzDA6r8os9IoyjtL0VbKGwyqjrDtPlEZg7uSi5Tl/nDjwHS9VL4FPBCH8yj7XLDrIZS xqsvgUrnqbx4QVu2FD/t6m5EQI/uGGw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702401436; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wGrwMn3JfvC8zxKlLnFKnxwP23z5yDH5T2HTwYNWebU=; b=seU2MZyQUvAnqoO+xitFjpRZ1bgE7CAN9LHGgR19mVdMTVvybhk5BbDQDNgnsIyHv2v/pC CmHBCDWfuE/nRxBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702401436; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wGrwMn3JfvC8zxKlLnFKnxwP23z5yDH5T2HTwYNWebU=; b=NebMt7YeVmCFr96OjrFTrzjDrvLyAq7UqhsLojCpI8+EwzRzw+EpBZG2gQ0MsbMRMtMhcJ 1EoIzDA6r8os9IoyjtL0VbKGwyqjrDtPlEZg7uSi5Tl/nDjwHS9VL4FPBCH8yj7XLDrIZS xqsvgUrnqbx4QVu2FD/t6m5EQI/uGGw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702401436; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wGrwMn3JfvC8zxKlLnFKnxwP23z5yDH5T2HTwYNWebU=; b=seU2MZyQUvAnqoO+xitFjpRZ1bgE7CAN9LHGgR19mVdMTVvybhk5BbDQDNgnsIyHv2v/pC CmHBCDWfuE/nRxBw== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 25373132DC; Tue, 12 Dec 2023 17:17:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 5JC4CJyVeGWfCAAAn2gu4w (envelope-from ); Tue, 12 Dec 2023 17:17:16 +0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] SRA: Force gimple operand in an additional corner case (PR 112822) Date: Tue, 12 Dec 2023 18:17:05 +0100 Message-Id: References: Cc: GCC Patches In-Reply-To: To: Martin Jambor X-Mailer: iPhone Mail (21C62) X-Spam-Level: X-Spam-Score: -1.04 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: 0.05 X-Spamd-Result: default: False [0.05 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.58)[81.44%]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(1.23)[0.409]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Flag: NO X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: > Am 12.12.2023 um 17:50 schrieb Martin Jambor : >=20 > =EF=BB=BFHi, >=20 > PR 112822 revealed a corner case in load_assign_lhs_subreplacements > where it creates invalid gimple: an assignment where on the LHS there > is a complex variable which however is not a gimple register because > it has partial defs and on the right hand side there is a > VIEW_CONVERT_EXPR. This patch invokes force_gimple_operand_gsi on > such statements (like it already does when both sides of a generated > assignment have partial definitions. >=20 > I've made sure the patch passes bootstrap and testsuite on x86_64-linux, > the bug reporter was kind enough to also check the same on an > powerpc64le-linux (see bugzilla comment #8). >=20 > The testcase has reasonable size but it is specific to ppc64le and its > altivec vectors. My plan is to ask the bug reporter to massage it into > a target specific testcase in bugzilla. Alternatively I can try to > craft a testcase from scratch but that will take time. >=20 > Despite the above, is the patch OK for master? Ok Richard=20 >=20 > Thanks, >=20 > Martin >=20 >=20 >=20 > gcc/ChangeLog: >=20 > 2023-12-12 Martin Jambor >=20 > PR tree-optimization/112822 > * tree-sra.cc (load_assign_lhs_subreplacements): Invoke > force_gimple_operand_gsi also when LHS has partial stores and RHS is a > VIEW_CONVERT_EXPR. > --- > gcc/tree-sra.cc | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc > index 3bd0c7a9af0..99a1b0a6d17 100644 > --- a/gcc/tree-sra.cc > +++ b/gcc/tree-sra.cc > @@ -4219,11 +4219,15 @@ load_assign_lhs_subreplacements (struct access *la= cc, > if (racc && racc->grp_to_be_replaced) > { > rhs =3D get_access_replacement (racc); > + bool vce =3D false; > if (!useless_type_conversion_p (lacc->type, racc->type)) > - rhs =3D fold_build1_loc (sad->loc, VIEW_CONVERT_EXPR, > - lacc->type, rhs); > + { > + rhs =3D fold_build1_loc (sad->loc, VIEW_CONVERT_EXPR, > + lacc->type, rhs); > + vce =3D true; > + } >=20 > - if (racc->grp_partial_lhs && lacc->grp_partial_lhs) > + if (lacc->grp_partial_lhs && (vce || racc->grp_partial_lhs)) > rhs =3D force_gimple_operand_gsi (&sad->old_gsi, rhs, true, > NULL_TREE, true, GSI_SAME_STMT); > } > -- > 2.43.0 >=20