From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 26CE43858D35 for ; Fri, 20 Oct 2023 15:22:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26CE43858D35 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 26CE43858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.220.29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697815371; cv=none; b=d9Hi4fY3EoBP9kMcLXQsvD0KE8ucI4RTym5y2PCbgyMWuH8hOVoCqa+9asR79nI5KrsyKBMMrDqYPm1T80a8fFinXPk9qHW5BHT3WkKUe8YQlJZYkpterUptyZT9uBEgoVEQWWY7/4LDeH3+WI9e90D2GJIT5RdaIViB7rUPMBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697815371; c=relaxed/simple; bh=BCwijgdX+zI49u6O7DPY4KtrPy7MaVb68jgS5MqThuM=; h=DKIM-Signature:DKIM-Signature:From:Mime-Version:Subject:Date: Message-Id:To; b=Z5Zm1zjwKtM8TfVvAMt/Xf9vUriHKq6AMYE81bsfI3EW6L0Fuvig8gle62N0RcRkHPtCYwpRl1xbiWyoSPHyxrZkyCt4Q2Pcd76hXI+iVSQhtBFslHdq4m0BBkFJT+1qyVHT9gO/tAwtRZsuooEv22D4YCbLsQUjPd+FZuJXJz8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9352F1F750; Fri, 20 Oct 2023 15:22:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697815366; 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=AmGsILt8UXpkCUFmzQb5VFya6ET3omEca42Dwd4nVys=; b=1o0XvI4ra8gNOxJhXNzYCoMz5xUlXSJ25t6B4cff+KrOVlVBi3aD4Wu5KCo3jSxTlXjZOK JuJAah6mUW6eM+aa9X0L4DjLfLtc689Q52T6epu+urxLUjlXj8YyjG1YeTgbX4Dd207Kr8 k+E4A+wEct4Wq9t6JRSZWPmjISKMXOM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697815366; 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=AmGsILt8UXpkCUFmzQb5VFya6ET3omEca42Dwd4nVys=; b=TA+XeAtYYgk5SiTqkWbUuGkud8v2m1WDpZo7nYAlQ348Ek787hfxt3w2WpnAl7oLEwx0qP Uve2PgeKOcI/ctDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7EDE2138E2; Fri, 20 Oct 2023 15:22:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sH3yHkabMmWuYgAAMHmgww (envelope-from ); Fri, 20 Oct 2023 15:22:46 +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] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882] Date: Fri, 20 Oct 2023 17:22:33 +0200 Message-Id: <28578A24-BE50-4EFA-85EF-759AE12D1F07@suse.de> References: <0bb61e0c-19c8-4029-844d-a97bba458689@arm.com> Cc: gcc-patches@gcc.gnu.org In-Reply-To: <0bb61e0c-19c8-4029-844d-a97bba458689@arm.com> To: "Andre Vieira (lists)" X-Mailer: iPhone Mail (20H30) Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -10.60 X-Spamd-Result: default: False [-10.60 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP 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 20.10.2023 um 15:47 schrieb Andre Vieira (lists) : >=20 > =EF=BB=BF >=20 >> On 20/10/2023 14:41, Richard Biener wrote: >>> On Fri, 20 Oct 2023, Andre Vieira (lists) wrote: >>> Hi, >>>=20 >>> This patch stops lowering of bitfields by ifcvt when they have non-const= ant >>> offsets as we are not likely to be able to do anything useful with those= >>> during >>> vectorization. That also fixes the issue reported in PR 111882, which w= as >>> being caused by an offset with a side-effect being lowered, but constant= s have >>> no side-effects so we will no longer run into that problem. >>>=20 >>> Bootstrapped and regression tested on aarch64-unknown-linux-gnu. >>>=20 >>> OK for trunk? >> + if (!TREE_CONSTANT (DECL_FIELD_OFFSET (rep_decl)) >> + || !TREE_CONSTANT (DECL_FIELD_BIT_OFFSET (rep_decl)) >> + || !TREE_CONSTANT (ref_offset) >> + || !TREE_CONSTANT (DECL_FIELD_BIT_OFFSET (field_decl))) >> + return NULL_TREE; >> DECL_FIELD_BIT_OFFSET is always constant. Please test >> TREE_CODE (..) =3D=3D INTEGER_CST instead of TREE_CONSTANT. >> OK with those changes. > After I sent it I realized it would've been nicer to add a diagnostic, you= OK with: > + if (dump_file && (dump_flags & TDF_DETAILS)) > + fprintf (dump_file, "\t Bitfield NOT OK to lower," > + " offset is non-constant.\n"); Sure. >> Richard. >>> gcc/ChangeLog: >>>=20 >>> PR tree-optimization/111882 >>> * tree-if-conv.cc (get_bitfield_rep): Return NULL_TREE for bitfields >>> with >>> non-constant offsets. >>>=20 >>> gcc/testsuite/ChangeLog: >>>=20 >>> * gcc.dg/vect/pr111882.c: New test. >>>=20