From patchwork Tue Jan 31 13:25:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 50861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2750528wrn; Tue, 31 Jan 2023 05:30:43 -0800 (PST) X-Google-Smtp-Source: AK7set9XurYkn/xcpSt8NhUudE9glTBRw6RA7ykEtoeI6e7K28RejSCqUGvjvZoFro7fKmXKS8IQ X-Received: by 2002:a05:6402:911:b0:4a2:5f73:d3d2 with SMTP id g17-20020a056402091100b004a25f73d3d2mr4295848edz.41.1675171842993; Tue, 31 Jan 2023 05:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675171842; cv=none; d=google.com; s=arc-20160816; b=fVq1g2Qa/VprMztgFs9pWop7lkp9copwP1RJ736nyFzcFffDV3tcUnOI43eL8SBCOT QmR7SYPjlViNB3dXexveHOEfg89TMjoPwA26tumUTaW8BpoqFnxLXjysnXoiOc3XpyjQ 5Xfrz2aqiGuhXghmScXoWLF+d9pu/RoDYTD+rKSO+35Fck/oAlUaxAQgPDJ0BQoDQkZm oQ1H2yxveN0GnkGvFs01PdwAsDXlcfhNeoriusG+UGvGuVI+ZHI5rpA+et+q88DDmb4/ zXhb5MrTsTfJ9umMM+AZZ2kjRF8YcOSzU9qj9XcU/SVapkyWzKaJngGJKgOwr0XPsn/4 RJJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=24a+00zZpCmCh9y+ZjCNHOKZrnnJOq01O9wV3T7OIg4=; b=yi8s90C+RDXzSk2uMeBbour06y/vFvl1vU86TVx5Wlwc1T8DC98jGJ3T0gxUXT38uk G72MT1+y6dS1FKY6JqJlZXYwe6osQel5uNYF8o31rpAuSGVpAvf6xv/Ne/LwOg490u2h b9ACoDsepESinCSQ0u758rd3UhwDIGWNRJWWdiRCEULkYTInhjko7x+ntLuZNy4/s4e3 FZs3EYAVUeV4gjGLYiEpeAy0nVN29eIBc2QA0lPr73HPJoOl8/5C2cqEpTSuySpKoEmI T961v7n+rej44f3RZmS3qbatofdPOeZkX1iUJ4611/q+YCwfo69n2heX6GdDwDZvG4g1 tSgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="BP/eVbrL"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x18-20020a05640226d200b004a249b8e8d5si7583201edd.450.2023.01.31.05.30.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 05:30:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="BP/eVbrL"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1849C38A909B for ; Tue, 31 Jan 2023 13:23:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id C56F938493E6 for ; Tue, 31 Jan 2023 13:21:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C56F938493E6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x331.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso5586653wms.5 for ; Tue, 31 Jan 2023 05:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=24a+00zZpCmCh9y+ZjCNHOKZrnnJOq01O9wV3T7OIg4=; b=BP/eVbrLg+X7arZc0f/NZ2cMiRhK2T9hgOrmuv5jbEeD/K6oGnUovK5Ol0Ok6gslCX naE214gRRG0XlEZLTjH1Kubz0lFavAPASiDD2OkIi0AruOR/fcG/7g2o2rYxW4Q8Sdmx x27tUhDWcUjQY3XTLKF4Sbj8PtXU8Cxpm6eU1ow72H4rNod209c218iDppQ9jLXPO3pj aOM3y0AT+9l6+HjPERFLFy4+PpkkPYZGRQtyTzSFa2uk2fxWLWJU7wqpPTYtMLSUApMk PgV/9/yXOi5RDwOHUhdfczDS0G5h70DVGjoojw8C75YEfH1E2tcuPAdRJGQ3is7+0Kr+ bKpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=24a+00zZpCmCh9y+ZjCNHOKZrnnJOq01O9wV3T7OIg4=; b=RrRiekC05Em8zRIaZxR72gnNmu5i1fjp5KNsf0f3ZIefE3sgQ7TAM2S8LIxp3dRN5l NEMVZavfoUe+dDyAk/6dLev7zuEXl9apAaJPzIVLL1x+c8p4jhLWZdirnEOZGg1xL4FU hqWK5UWQaMNd+uGdIBJFX5m8RBZfHA54TwEB4ySWqGVV8eJJwET3kXnjgVqgqsJIJc/i 5rrBM61bG80Cee9ZQzt7Cvm4DumZfETqeHY0u+kxftz8Tdi9aMDTn6lUQmliR2RAlaRW QQg/DBRYdtRr3VUboyun653w0aymJswxqeiB7M1IROps2okmFVeQnIP7bnc70pHL7Kzf UOBA== X-Gm-Message-State: AFqh2koo3HcNxGyaXORU9IRslPh3ipHnMp9riU5xyFawOIm19koHrncp zsesNYEU53ClIhHsWnkkWS28kCrxrGJk8fRNPw== X-Received: by 2002:a05:600c:a15:b0:3db:18a0:310f with SMTP id z21-20020a05600c0a1500b003db18a0310fmr51471004wmp.33.1675171305158; Tue, 31 Jan 2023 05:21:45 -0800 (PST) Received: from platypus.lan ([2001:861:5e4c:3bb0:6424:328a:1734:3249]) by smtp.gmail.com with ESMTPSA id f9-20020a7bcd09000000b003dc54344764sm7919378wmj.48.2023.01.31.05.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 05:21:44 -0800 (PST) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron Subject: [COMMITTED] gccrs: Remove param_use_canonical_types checks ported from c++ front-end Date: Tue, 31 Jan 2023 14:25:30 +0100 Message-Id: <20230131132530.662219-1-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-15.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756544990514253385?= X-GMAIL-MSGID: =?utf-8?q?1756544990514253385?= From: Philip Herron We are not fully setting TYPE_CANONICAL yet but we don't need to be as strict as the C++ front-end yet. param_use_canonical_types is a command line option we are not using either. gcc/rust/ChangeLog: * backend/rust-tree.cc (comptypes): Remove some C++ specific checks in Rust const folder for now. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/backend/rust-tree.cc | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc index d79cd96f011..d2ddcfd2957 100644 --- a/gcc/rust/backend/rust-tree.cc +++ b/gcc/rust/backend/rust-tree.cc @@ -2916,27 +2916,7 @@ comptypes (tree t1, tree t2, int strict) perform a deep check. */ return structural_comptypes (t1, t2, strict); - if (flag_checking && param_use_canonical_types) - { - bool result = structural_comptypes (t1, t2, strict); - - if (result && TYPE_CANONICAL (t1) != TYPE_CANONICAL (t2)) - /* The two types are structurally equivalent, but their - canonical types were different. This is a failure of the - canonical type propagation code.*/ - internal_error ( - "canonical types differ for identical types %qT and %qT", t1, t2); - else if (!result && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2)) - /* Two types are structurally different, but the canonical - types are the same. This means we were over-eager in - assigning canonical types. */ - internal_error ( - "same canonical type node for different types %qT and %qT", t1, - t2); - - return result; - } - if (!flag_checking && param_use_canonical_types) + if (!flag_checking) return TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2); else return structural_comptypes (t1, t2, strict);