From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 550863858D35 for ; Thu, 29 Jun 2023 09:55:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 550863858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-992b2249d82so46964066b.1 for ; Thu, 29 Jun 2023 02:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688032510; x=1690624510; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YJ+DHJ8Us1QqWSZDe2MMsDaqaQKWfev9Vtt+AdDvdwA=; b=P3uDJlXCh5boATH26DRGg5D6bLztyTjPMbSAX7V8Uqr0OFeGL/mT3QhD94Gh+MuTxd 6XHXE3qcudhfRoD5OfPfFznJGkWbDYYHxq73cJ46C+ynFJP7PoWeXfzdLJI3wqPUfGS1 ZHQAPRyGCX0GMLGDZclsSECcWrpe+1uuIr2hHwRKCNwCmjfXHiZCyW+bFIFdeeIcpAso LGj/DJtOrZgEVZAcWz4bed81+GPaujtSPnTC2j9VA8H0uJcFm2h8w1QDGMZuERI0cher lJeVeu1ieujzhe6nQmXDBrmK+/hUIpkG8kYfKanaSekTTm339q9CNtACLnT1yNwda7bN u9QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688032510; x=1690624510; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YJ+DHJ8Us1QqWSZDe2MMsDaqaQKWfev9Vtt+AdDvdwA=; b=GNdoVy7CljtcO/tD34zubJupSnLH6o2hC73q9LdCz1T0bfLl21RIgTwaZ5gXY+e5Pi 8oor1meMHvmt3859b/YzP7a25Hqnf9Q0C+Aw++5Nzw1SBbYnntS/ucEXnQyXQ6aNg1f9 7vO+8aTyh9pTZHib7+xmKHAmUoNDz8llj4AVED/psyYUFYakZTlXTHFBhCPM6c55Uml7 168MnL/Bx4AKupSZ8dUgnB9sgtPKqT8INfdvYarrOAQKT8b2pO3X2GZa/pP3EWCLQMgo o7ViBHOlhn/+/CuEwcdiSDN4hepnOjDpbqF6dKmeWEXv3z0fyf1D6EQkj0yf7sQhVjeC jDsQ== X-Gm-Message-State: AC+VfDyaoaRftjfzoIopftDOZzGgY/FCYajoL9zRvJoxnUAsfjfc2zZ8 3V2lm8VCb2jtn/n7VEHijdA= X-Google-Smtp-Source: ACHHUZ4Bp5IuHwD+yxklxK5Ox8zOIXrgsU+WyTklMopUAqguQTQ/n61da/zILRNG9m6veZAsS6LOSQ== X-Received: by 2002:a17:906:5a51:b0:991:c9da:70da with SMTP id my17-20020a1709065a5100b00991c9da70damr9155263ejc.61.1688032509728; Thu, 29 Jun 2023 02:55:09 -0700 (PDT) Received: from [192.168.1.23] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id k7-20020a170906a38700b00985ed2f1584sm6593190ejz.187.2023.06.29.02.55.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jun 2023 02:55:09 -0700 (PDT) Message-ID: <6e53ae2d-3706-c1ac-ff41-2bd85b2fe596@gmail.com> Date: Thu, 29 Jun 2023 11:55:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Cc: rdapp.gcc@gmail.com, "Li, Pan2" , Jakub Jelinek , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Prevent TYPE_PRECISION on VECTOR_TYPEs Content-Language: en-US To: Richard Biener , Jeff Law References: <20230627094533.C82C713462@imap2.suse-dmz.suse.de> <7483d3e6-cfac-dd21-e5d7-5f4611b2e214@gmail.com> From: Robin Dapp In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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: > 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? Since nobody else has provided a patch yet, is the attached OK as long as x86 bootstrap and testsuite are clean? Regards Robin >From 5ac3bb96cae0af99cefeaa225806de67e268e8f5 Mon Sep 17 00:00:00 2001 From: Robin Dapp Date: Thu, 29 Jun 2023 11:35:02 +0200 Subject: [PATCH] ssa-math-opts: Use element_precision. The recent TYPE_PRECISION changes to detect improper usage cause an ICE in divmod_candidate_p for RVV when called with a vector type. Therefore, use element_precision instead. gcc/ChangeLog: * tree-ssa-math-opts.cc (divmod_candidate_p): Use element_precision. --- gcc/tree-ssa-math-opts.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index da01d4ab2b6..701fce2ab61 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -4995,8 +4995,8 @@ divmod_candidate_p (gassign *stmt) if (integer_pow2p (op2)) return false; - if (TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT - && TYPE_PRECISION (type) <= BITS_PER_WORD) + if (element_precision (type) <= HOST_BITS_PER_WIDE_INT + && element_precision (type) <= BITS_PER_WORD) return false; /* If the divisor is not power of 2 and the precision wider than -- 2.41.0