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 41AD23858420 for ; Thu, 18 Jan 2024 07:33:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41AD23858420 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 41AD23858420 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=1705563187; cv=none; b=t11Yzf1M0uBuTFYsbfnOgKeeC+RR9Jm/BUgnSJXD2BZ/Fm+tIedWqhqJqnHp9QZCj9lgAez830aNBHZwdAJ6zl0bjP29XQlsH3PAWM9AUPsr41Y2LBxvEI6Rm0wyenyOghAqLmsQDZb1EJgDSAQuS8tyDlVUZXDbQDRLfuWaoWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705563187; c=relaxed/simple; bh=TY30xNskRvEcWV2e0o31oJbPeAqyYUVoiWEFnCq8qyE=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=SglN3g47AvI8j/TyYhAZwisb6/nagixV6eXh7TQaW8WJS1HuSINPhXP1El0mvfKCrgJsq0r8mdPov9wXbja7oEiodMhL5Bn5X6xApUuypBStRdmo148PcrKdSpzXpbgsSHOv0WBdjsgtKJkfiy2gGW9sLnxSk1GdIw1BbC2fUEU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.4.150] (unknown [10.168.4.150]) (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 068EA222A5; Thu, 18 Jan 2024 07:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705563180; h=from:from:reply-to: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=pUBH6vbshTZjLyXuKkdUca10hpoNc0yRZQk3/7al1U0=; b=VeYJuAoNmhY3tzc4cK7hUxBRW8lNReh48VAjBkIryOyBfSq3Ywz9wHZIyk5+GreEYi+rbs liJOVIC0fAwv/mgEeV25tS3wk4WNi0w+LBWaumGFQXJYWopZ7HEPfHA8JpsSe6VVVupYv8 eW/iV+a+DLa0cPlk5qQ7ZiWg3o9ZVPA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705563180; h=from:from:reply-to: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=pUBH6vbshTZjLyXuKkdUca10hpoNc0yRZQk3/7al1U0=; b=0/N0S8f2munJW8Z2r3Hjve9xQTSPHr6ch7fPBimVspQPjHt1lJswXtJfN1t5EHxCHndSfZ SKwx5QOyhREm9uBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705563180; h=from:from:reply-to: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=pUBH6vbshTZjLyXuKkdUca10hpoNc0yRZQk3/7al1U0=; b=VeYJuAoNmhY3tzc4cK7hUxBRW8lNReh48VAjBkIryOyBfSq3Ywz9wHZIyk5+GreEYi+rbs liJOVIC0fAwv/mgEeV25tS3wk4WNi0w+LBWaumGFQXJYWopZ7HEPfHA8JpsSe6VVVupYv8 eW/iV+a+DLa0cPlk5qQ7ZiWg3o9ZVPA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705563180; h=from:from:reply-to: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=pUBH6vbshTZjLyXuKkdUca10hpoNc0yRZQk3/7al1U0=; b=0/N0S8f2munJW8Z2r3Hjve9xQTSPHr6ch7fPBimVspQPjHt1lJswXtJfN1t5EHxCHndSfZ SKwx5QOyhREm9uBA== Date: Thu, 18 Jan 2024 08:27:51 +0100 (CET) From: Richard Biener To: Jakub Jelinek cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] lower-bitint: Force some arrays corresponding to large/huge _BitInt SSA_NAMEs to BLKmode In-Reply-To: Message-ID: <10q608oq-n50o-r767-94o0-p5o561415osr@fhfr.qr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-0.10 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,gimple-lower-bitint.cc:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-0.00)[39.71%] X-Spam-Level: X-Spam-Score: -0.10 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On Thu, 18 Jan 2024, Jakub Jelinek wrote: > Hi! > > On aarch64 the backend decides to use non-BLKmode for some arrays > like unsigned long[4] - OImode in that case, but the corresponding > BITINT_TYPEs have BLKmode (like structures containing that many limb > elements). This both isn't a good idea (we really want such underlying vars > to live in memory and access them there, rather than live in registers and > access their parts in there) and causes ICEs during expansion > (VIEW_CONVERT_EXPR from such OImode array to BLKmode BITINT_TYPE), so the > following patch makes sure such arrays reflect the BLKmode of BITINT_TYPEs > it is accessed with (if any). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? So the issue is only manifesting during expansion? I think it would be better to detect the specific issue (V_C_E from register to BLKmode) in discover_nonconstant_array_refs_r and force the register argument to stack? > 2024-01-18 Jakub Jelinek > > * gimple-lower-bitint.cc (gimple_lower_bitint): When creating > array VAR_DECL for BITINT_TYPE SSA_NAMEs which have BLKmode, force > DECL_MODE of those vars to be BLKmode as well. > > --- gcc/gimple-lower-bitint.cc.jj 2024-01-17 14:43:33.498961304 +0100 > +++ gcc/gimple-lower-bitint.cc 2024-01-17 14:50:50.252889131 +0100 > @@ -6348,7 +6348,15 @@ gimple_lower_bitint (void) > tree s = ssa_name (i); > int p = var_to_partition (large_huge.m_map, s); > if (large_huge.m_vars[p] != NULL_TREE) > - continue; > + { > + /* If BITINT_TYPE is BLKmode, make sure the underlying > + variable is BLKmode as well. */ > + if (TYPE_MODE (TREE_TYPE (s)) == BLKmode > + && VAR_P (large_huge.m_vars[p]) > + && DECL_MODE (large_huge.m_vars[p]) != BLKmode) > + DECL_MODE (large_huge.m_vars[p]) = BLKmode; > + continue; > + } > if (atype == NULL_TREE > || !tree_int_cst_equal (TYPE_SIZE (atype), > TYPE_SIZE (TREE_TYPE (s)))) > @@ -6359,6 +6367,11 @@ gimple_lower_bitint (void) > } > large_huge.m_vars[p] = create_tmp_var (atype, "bitint"); > mark_addressable (large_huge.m_vars[p]); > + /* If BITINT_TYPE is BLKmode, make sure the underlying > + variable is BLKmode as well. */ > + if (TYPE_MODE (TREE_TYPE (s)) == BLKmode > + && DECL_MODE (large_huge.m_vars[p]) != BLKmode) > + DECL_MODE (large_huge.m_vars[p]) = BLKmode; > } > } > > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)