From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 81D0E3858D35 for ; Thu, 29 Jun 2023 08:11:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81D0E3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A06441F896; Thu, 29 Jun 2023 08:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688026287; 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=Jy+bfOGI+Fmw/ZBuuDWsuK8A0ZrL4vzkOvWkLQdI5cA=; b=aMRZF+E3gFO/SPPJP9oICe8GZy8XYl11MBTmVfkKNRGbKI9TjdsExRv95qa0HJdQyC5AD3 zzwk4KYLNWvIXR58okU5FhTioOTTGEbhmf5lIt2zs1LCTVAnfiLPX/p7rQbp/uLLEsHni1 ro4ocmCZ8JT56Lzp76mr2J7SBuMp+Pg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688026287; 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=Jy+bfOGI+Fmw/ZBuuDWsuK8A0ZrL4vzkOvWkLQdI5cA=; b=ajqXpr+spMpFtURlB/EPwKVYu50J5z1qnsfDWi/LtxZdDnEITJxvvfb7gE1NR9lYbptStS 63g0JbYtvNlkfTCA== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8E0192C141; Thu, 29 Jun 2023 08:11:27 +0000 (UTC) Date: Thu, 29 Jun 2023 08:11:27 +0000 (UTC) From: Richard Biener To: Jeff Law cc: "Li, Pan2" , Jakub Jelinek , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Prevent TYPE_PRECISION on VECTOR_TYPEs In-Reply-To: <7483d3e6-cfac-dd21-e5d7-5f4611b2e214@gmail.com> Message-ID: References: <20230627094533.C82C713462@imap2.suse-dmz.suse.de> <7483d3e6-cfac-dd21-e5d7-5f4611b2e214@gmail.com> User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.9 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 Wed, 28 Jun 2023, Jeff Law wrote: > > > On 6/28/23 22:04, Li, Pan2 wrote: > > It seems this patch may result in many test ICE failures on RISC-V backend. > > Could you help to double confirm about it follow the possible reproduce > > steps like blow? Thank you! > I've one ICE due to this change as well but it wasn't in the > tree-ssa-math-opts.code like this one is. In my case we're in a place where > it doesn't look like we expect a vector type to show up, but it does and we > can likely just prune it away. > > Anyway, your fault is in here: > > > > divmod_candidate_p: > > if (TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT > && TYPE_PRECISION (type) <= BITS_PER_WORD) > return false; > > TYPE is almost certainly a vector type. The question we need to answer (and > I'm not likely to get to it tomorrow) would be whether or not TYPE can > legitimately be a vector type here. I think GCN people wanted to make this code work for vectors, the most obvious local fix is to use element_precision (type) above. Note usually vector integer divisions are not a thing so this might explain why you're seeing this only with RVV? Richard.