From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <SRS0=0XWR=JH=redhat.com=jakub@sourceware.org> 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 ADB4D3858D20 for <gcc-patches@gcc.gnu.org>; Mon, 29 Jan 2024 12:17:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ADB4D3858D20 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 ADB4D3858D20 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=1706530646; cv=none; b=Tp3iD4OQNbLs9daJ+2P9wRwDiyArpHcyjm6rDGXZBTrTwtQCaWeZvVlPJlhJ8kIzx7HwE1kzO/0s8YZ3z8ZJwjDOJd9k1E1yckMKPBnovrp4z0JUAJUbVMC1+OXhgqqZpJ3yLd7obsR/nGF/wSFu6OABIx0w0d2R2GCLGPFVLs4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706530646; c=relaxed/simple; bh=8roSPVQqSEbYbTY9J4L+XyJkohUjQBYhZL20/VY+Aq8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ttVJudAQuyGkjLKlGt/AHZWwtZC/njLqVWCP488XWOMaD5EH9D3Zvdj9/5Pu0c5MC2uXVKkJRQAHvA+V2GsFwIVqMbbnEdVhlGmMf7jYGWKmFxQMKr0KGFTdljJqBkGRPP7f31ijLmCgcBfC1qTFA2Oi9cEqyw1FhByxNGTXGZw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706530644; 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=Yu+koydxhEJVs6Pw4TLWxzO/ui7DgA1uu69sxpXzJYY=; b=eq66lEEk8ekA94wpBMhgnpHKn/nV1sYQSAqqS8v2Obp0qHI3mI1qGpLEU6GE8eEVMtbBsB GNK9H/Yghn3axDbBFbacd2UkbBxII7ygQ6uNGtVGK1bQyE0BHdVoiPC6fna6iFVnJbgndD Z5pDaEEnV9xFdVyI4r90NfyT7mu0PsI= 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-82-K1I1O0n_ObyjVKF-xjBT-A-1; Mon, 29 Jan 2024 07:17:21 -0500 X-MC-Unique: K1I1O0n_ObyjVKF-xjBT-A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 DC70A86C044; Mon, 29 Jan 2024 12:17:20 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F5AE492BE2; Mon, 29 Jan 2024 12:17:20 +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 40TCHHll2973894 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 13:17:18 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40TCHHNU2973893; Mon, 29 Jan 2024 13:17:17 +0100 Date: Mon, 29 Jan 2024 13:17:16 +0100 From: Jakub Jelinek <jakub@redhat.com> To: Richard Biener <rguenther@suse.de> Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] middle-end/113622 - handle store with variable index to register Message-ID: <ZbeXTGAvXVh8JpQa@tucnak> Reply-To: Jakub Jelinek <jakub@redhat.com> References: <04221.124012907112600441@us-mta-365.us.mimecast.lan> MIME-Version: 1.0 In-Reply-To: <04221.124012907112600441@us-mta-365.us.mimecast.lan> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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: <gcc-patches.gcc.gnu.org> On Mon, Jan 29, 2024 at 01:05:51PM +0100, Richard Biener wrote: > The following implements storing to a non-MEM_P with a variable > offset. We usually avoid this by forcing expansion to memory but > this doesn't work for hard register variables. The solution is > to spill and operate on the stack. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > I realize the flow is a bit awkward, but short of duplicating a lot > of code I can't see a better way. Forcing some lowering on GIMPLE > (creating the copy there) might be another away. But then we > could possibly lower the whole vector indexing in a different way > in the first place ... > > Thanks, > Richard. > > PR middle-end/113622 > * expr.cc (expand_assignment): Spill hard registers if > we index them with a variable offset. > > * gcc.target/i386/pr113622-2.c: New testcase. > * gcc.target/i386/pr113622-3.c: Likewise. Ok, thanks. Jakub