From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0247F3858414 for ; Thu, 18 Jan 2024 13:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0247F3858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0247F3858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705583644; cv=none; b=xFSNa7orrCctjV9vhgQ4tvPyyRiyrp5stAqHmUwUBViyQmhe0I96H3b566fPTemFHRWYr0AkCqLcWHS8mv36VuokfxNuyFMoX5ETNcn9WngF/Xal7zTXxty3qqm/PNBCFTdZS8jG8LFJ1DiJc5E4oNITr9Lfxn5TWjLE3OUHOIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705583644; c=relaxed/simple; bh=+LlfLuaVfJplO/owoqbY4XAbgdymza3+EVaTbOSfN/w=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=uJq6wH8k6k43Vt3h5y797GuI+r6vIQxAlH1/U8Rj79ns6RJA0zMeIxJWZhDo9CV20gNKkBu7EVugf7NgSHkNKhJRDQbiQGvslGSP6HzSNJR6areGqu/xol2iIqfzY7R9wFN2Qgy0LZh3akICE4PIrnGioxdlE7NGWROW85Y4pF0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705583642; h=from:from:reply-to: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=TWlSZ/zKs7ETnzB84bG+fTkYuMcGAlLv/AALx9XtYyw=; b=GYKtUDhagbnMwzAxyy9hbo8R8YuYu7/zDgVJlwM1QvBMwh/xDalQyX8MuvbI7KbR4gibGl R4SS9MV0Z/pqCbwaDldR9qunXAKw+++tWzn/+ei+BPqyuScW1w/whVqqfUE4KAQe1JMBLW 5rM9OcOwguBnZnEX7HlJOe+WhaVtdeY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-177-dIGwP_HYOLOxFgJMx9-V4A-1; Thu, 18 Jan 2024 08:13:59 -0500 X-MC-Unique: dIGwP_HYOLOxFgJMx9-V4A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B9BD83B878; Thu, 18 Jan 2024 13:13:59 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D40021C05E0E; Thu, 18 Jan 2024 13:13:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 40IDDuOq249889 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 18 Jan 2024 14:13:56 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40IDDtUQ249888; Thu, 18 Jan 2024 14:13:55 +0100 Date: Thu, 18 Jan 2024 14:13:55 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] lower-bitint: Force some arrays corresponding to large/huge _BitInt SSA_NAMEs to BLKmode Message-ID: Reply-To: Jakub Jelinek References: <10q608oq-n50o-r767-94o0-p5o561415osr@fhfr.qr> <257o685n-4254-9so7-sq07-p39s38742o33@fhfr.qr> <4n82q8o2-6333-4493-214o-p63so73sr049@fhfr.qr> <3338sq3o-q418-6894-30qs-q720097r4477@fhfr.qr> MIME-Version: 1.0 In-Reply-To: <3338sq3o-q418-6894-30qs-q720097r4477@fhfr.qr> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 Thu, Jan 18, 2024 at 01:57:49PM +0100, Richard Biener wrote: > > - RTL expansion expectes TARGET_MEM_REF to always address actual memory. */ > > + RTL expansion expectes TARGET_MEM_REF to always address actual memory. > > + Also, force to stack non-BLKmode vars accessed through VIEW_CONVERT_EXPR > > + to BLKmode BITINT_TYPEs. */ > > else if (TREE_CODE (t) == TARGET_MEM_REF > > || (TREE_CODE (t) == MEM_REF > > && TYPE_SIZE (TREE_TYPE (t)) > > - && POLY_INT_CST_P (TYPE_SIZE (TREE_TYPE (t))))) > > + && POLY_INT_CST_P (TYPE_SIZE (TREE_TYPE (t)))) > > + || (TREE_CODE (t) == VIEW_CONVERT_EXPR > > + && TREE_CODE (TREE_TYPE (t)) == BITINT_TYPE > > + && TYPE_MODE (TREE_TYPE (t)) == BLKmode)) > > I'm still not getting what's special about BITINT_TYPE here so > shouldn't that apply to all BLKmode V_C_E? But sure we can for > now just handle BITINT_TYPE. > > That hunk looks OK to me. The == BITINT_TYPE check is non-essential, was just trying to keep existing behavior otherwise. I can certainly drop that. > > --- gcc/expr.cc.jj 2024-01-12 10:07:58.194851657 +0100 > > +++ gcc/expr.cc 2024-01-18 13:38:19.677556646 +0100 > > @@ -12382,6 +12382,17 @@ expand_expr_real_1 (tree exp, rtx target > > } > > } > > > > + /* Ensure non-BLKmode array VAR_DECLs VCEd to BLKmode BITINT_TYPE > > + aren't promoted to registers. */ > > + if (op0 == NULL_RTX > > + && mode == BLKmode > > + && TREE_CODE (type) == BITINT_TYPE > > + && VAR_P (treeop0) > > + && DECL_MODE (treeop0) != BLKmode > > + && DECL_RTL_SET_P (treeop0) > > + && MEM_P (DECL_RTL (treeop0))) > > + op0 = adjust_address (DECL_RTL (treeop0), BLKmode, 0); > > + > > if (!op0) > > op0 = expand_expr_real (treeop0, NULL_RTX, VOIDmode, modifier, > > NULL, inner_reference_p); > > So we're now sure we have MEM_P (op0) after expand_expr_real, > even without this change, right? What's wrong with the > suggestion to use I wasn't sure if VAR_P (treeop0) && MEM_P (DECL_RTL (treeop0)) implies that expand_expr_real will return a MEM, but I'm not able to find a path in which it would return something different, so maybe ok. > if (mode == GET_MODE (op0) || (mode == BLKmode && MEM_P (op0)) > > thus not run into any of the special-casing? We're doing just It is true the later code will then do: > > op0 = adjust_address (op0, mode, 0); so perhaps it is ok as you wrote it (though perhaps adding it as a separate else if would allow a separate comment). Jakub