From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 5ED383858D20 for ; Tue, 30 May 2023 14:16:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5ED383858D20 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-pf1-x42e.google.com with SMTP id d2e1a72fcca58-64d2c865e4eso3383671b3a.0 for ; Tue, 30 May 2023 07:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685456207; x=1688048207; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8ibFrxcoXCYgOQMlOUDLQK4PeDgnObGYOTLnMKBGOlA=; b=j4CVOXw4X/v047o4DWOehwJlXOA84Vv2rcJHhwfDEAKwWfV5F4FPRmfziCxMspr1cD qsHRliUQO4YkpLB8FdpoGiS9ISZ4ukIoBKCrphPcRlfNgmwuZxMBMenAEx26y1J5KJUh Np6qS/6Q5mkQEVTb5tw4EKmIb6UgI8I6Di0DAcilIu3Vx3O7j+d9JFEevyJaB1hq0j9D 6OhY+02p5jq9uOmdq96NiORETMO/4Z67cyh0XUd5f0eg78u+rkW8SeZhqohxrqpZLXya rsMEeqAOvVThaOjnttV+AG0oMc1d6Dz7iyCzTEQjHUZ9RKaLcT1QlDxUSrBbPcqWDlYV KjZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685456207; x=1688048207; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8ibFrxcoXCYgOQMlOUDLQK4PeDgnObGYOTLnMKBGOlA=; b=DZhFUZk5Zu+rd3EKT30SKLpgR8eaWcDRZEKXY0H7ttFy/zRs9lubKq+QWL1NOZ7lEZ muoM6dhNIS1Aah1PqnGSKImZLIHPd6s6LgzosX95nljtyd4WQYgPWk6xUfCrM3zKbDgZ LXPdB26UkoAxmxxFZ1/u5iUnaZhDHkUE3slSZpCIfHnoguWSQ6eUYwl8qt9HRtkOHz1S lREvdHsu5PSvPC73ZNDXmq0ZV60RLqamqMgpi5gHc04dCashFOH19OUzlqmHtv4B6R+Z EdMTSARX67u84IP6eDtL+4a25pvvXGGcPRv06e6cTjL9IYnOiIyozK61TJMK4SB3onc8 rzXQ== X-Gm-Message-State: AC+VfDxgc/75JG3uk6RiIviy+gxpIIgd9PESJULu5AR82jeGNgHk6sny YH8Cbq3ZSaSiofE3/dXbHRBYceIsA/Q= X-Google-Smtp-Source: ACHHUZ5YZteacxC6HSC2onxa7jMba+ndMhisKvDiUpTLkTbtW1IgqpIrX58NwhjPBctdri8S8noOVQ== X-Received: by 2002:a17:902:e993:b0:1ac:a02f:c9a4 with SMTP id f19-20020a170902e99300b001aca02fc9a4mr2791791plb.4.1685456207447; Tue, 30 May 2023 07:16:47 -0700 (PDT) Received: from ?IPV6:2601:681:8d00:265::f0a? ([2601:681:8d00:265::f0a]) by smtp.gmail.com with ESMTPSA id w9-20020a170902e88900b001b06deeb319sm962013plg.300.2023.05.30.07.16.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 07:16:46 -0700 (PDT) Message-ID: <6f26c12a-bdbd-740d-da68-1d5d01dfc40e@gmail.com> Date: Tue, 30 May 2023 08:16:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Fix type error of 'switch (SUBREG_BYTE (op)).' Content-Language: en-US To: Jeff Law via Gcc-patches , Jin Ma , jinma.contrib@gmail.com, richard.sandiford@arm.com References: <20230517090315.795-1-jinma@linux.alibaba.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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: On 5/23/23 06:27, Richard Sandiford wrote: > Jeff Law via Gcc-patches writes: >> On 5/17/23 03:03, Jin Ma wrote: >>> For example: >>> (define_insn "mov_lowpart_sidi2" >>> [(set (match_operand:SI 0 "register_operand" "=r") >>> (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))] >>> "TARGET_64BIT" >>> "mov\t%0,%1") >>> >>> (define_insn "mov_highpart_sidi2" >>> [(set (match_operand:SI 0 "register_operand" "=r") >>> (subreg:SI (match_operand:DI 1 "register_operand" " r") 1))] >>> "TARGET_64BIT" >>> "movh\t%0,%1") >>> >>> When defining the above patterns, the generated file insn-recog.cc will >>> appear 'switch (SUBREG_BYTE (op))', but since the return value of >>> SUBREG_BYTE is poly_uint16_pod, the following error will occur: >>> "error: switch quantity not an integer". >>> >>> gcc/ChangeLog: >>> >>> * genrecog.cc (print_nonbool_test): Fix type error of >>> 'switch (SUBREG_BYTE (op))'. >> Thanks. Installed. > > We shouldn't add to_constant just because it's a convenient > way of getting rid of errors :) There has to be a good reason > in principle why the value is known at compile time. Agreed. I fully expected the constant to be known at compile time. I wasn't aware we had real uses of polys in the SUBREG_BYTE field. > > So I think this should be reverted. Nothing guarantees that > SUBREG_BYTEs are constant on AArch64 and RISC-V. And for SVE > it's common for them not to be. That's fine with me. Jeff