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.133.124]) by sourceware.org (Postfix) with ESMTPS id 7CDF03858430 for ; Thu, 18 Jan 2024 13:18:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CDF03858430 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 7CDF03858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705583927; cv=none; b=uvEy8jGgmkJ5UhPksZcFnhFjzNSvMDxhEPjVwtkhkac8vP9VKypDupD38U6MIW4aM2DQtt4oLxpmqwqnKiPtv45pP9lOPyq6RAKppuxu1aJHc63fScdjqt/DkeZljHMn0o/+CQ7exWwXwIqf8UBy2d5baakH3a2xujV5fQWl2zM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705583927; c=relaxed/simple; bh=UMsZ5LHLdO/+SbaJLfyW6EHkEOwBqJ+ns4wue4G2494=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=hNbVEpJlE5U2ZCuMHXTBu0xijqk++rjBJx8/7lADtEwIBXzjApZFCsT465j6/5S6+pWPWYrK3On2RUDCmz7BtRhsoTKiG+RZFp06NYvhAAyBDa5KKnDCl+x7F4aoDGu/SGHLHobm7Q509a+kmxRzsLpS7ZTwhtcPa6sNRSegryw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705583926; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=HJcu2dGiOeMTRGQQaxDIZFzSWdgPMb2XbIoUsHQaUgU=; b=SmMDjPtwTgblUSeCDJDXwHAjxAHxPDhfqKXZTdFzO+Gw1g00MxWVCZ7vXt/dtDjZ+/6QhQ dMztbvZQn5A4ktdA7Q0hsKyTDLNUVd4VubNwTNYHFcHW2iTAeCh118FUlxDZ55widBeHzF w0w62X5Y0m0/grFmvxz9nLgD05thrbQ= 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-340-Yg3_athNMiyKkEfsSizPvw-1; Thu, 18 Jan 2024 08:18:44 -0500 X-MC-Unique: Yg3_athNMiyKkEfsSizPvw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 91C0A845E36; Thu, 18 Jan 2024 13:18:44 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54EBEC0FDCA; Thu, 18 Jan 2024 13:18:44 +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 40IDIaab250332 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 18 Jan 2024 14:18:37 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40IDIa61250331; Thu, 18 Jan 2024 14:18:36 +0100 Date: Thu, 18 Jan 2024 14:18:36 +0100 From: Jakub Jelinek To: Richard Biener , 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: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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_H3,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 02:13:55PM +0100, Jakub Jelinek wrote: > The == BITINT_TYPE check is non-essential, was just trying to keep existing > behavior otherwise. I can certainly drop that. So following then? 2024-01-18 Jakub Jelinek Richard Biener * cfgexpand.cc (discover_nonconstant_array_refs_r): Force non-BLKmode VAR_DECLs referenced in BLKmode VIEW_CONVERT_EXPRs into memory. * expr.cc (expand_expr_real_1) : Do nothing but adjust_address also for BLKmode mode and MEM op0. --- gcc/cfgexpand.cc.jj 2024-01-16 11:45:16.159326506 +0100 +++ gcc/cfgexpand.cc 2024-01-18 14:15:54.853008586 +0100 @@ -6380,11 +6380,15 @@ discover_nonconstant_array_refs_r (tree /* References of size POLY_INT_CST to a fixed-size object must go through memory. It's more efficient to force that here than to create temporary slots on the fly. - 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 type. */ 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 + && TYPE_MODE (TREE_TYPE (t)) == BLKmode)) { tree base = get_base_address (t); if (base --- gcc/expr.cc.jj 2024-01-12 10:07:58.194851657 +0100 +++ gcc/expr.cc 2024-01-18 14:15:31.970328685 +0100 @@ -12389,6 +12389,10 @@ expand_expr_real_1 (tree exp, rtx target /* If the input and output modes are both the same, we are done. */ if (mode == GET_MODE (op0)) ; + /* Similarly if the output mode is BLKmode and input is a MEM, + adjust_address done below is all we need. */ + else if (mode == BLKmode && MEM_P (op0)) + ; /* If neither mode is BLKmode, and both modes are the same size then we can use gen_lowpart. */ else if (mode != BLKmode Jakub