From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 5CDC7385772A for ; Thu, 15 Jun 2023 08:04:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CDC7385772A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-311099fac92so1560622f8f.0 for ; Thu, 15 Jun 2023 01:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1686816278; x=1689408278; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yM8dwB2SN548sKAv41psJE3phP4Ldcfs8CZl/tfK36Q=; b=g0QoUqQP/HG/O8UrkMVsiDlmg+7ceHY3xYHw0efXeW56pXqoiFQ5GDuHqURZCJgAuK fB13XKLz7NZ7xxJ+fsx2SznGcUIQEa6/slN1dpC1En8WapekKzdEnnRRRu0ERcqMY9fY /csYEij9DxW7hagPMR49b7ZHLrKJqRv2wgQhEOoQHYBECxh7SMchbF9spKqSxSyysEuh nImb5k/tsgRidQvgPoz0OHpYrYvTa8TGmE6NiByJJRD2xrsU2gAQpS93Yc5+kipLcd8F y6O66PxlvykVYAJaF3Izo8Yi2aop81KFMHEhpN/VKAXOw1LMyUnnOAqWjMxSPwtLit0W nmGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686816278; x=1689408278; 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=yM8dwB2SN548sKAv41psJE3phP4Ldcfs8CZl/tfK36Q=; b=KiYHaYcIhjqyFRhxtzlHS19SqmmYduALnfzZuEtMhT3wVl2FUCcXLGfAHBXG9ll7MO 4yJm2OIIHz1wNg/tEBmbghThYpZ2OhoQw4FI7tBWo7HwZVASY83YqRLRBuGneajT975l pXrbURPF5I5xcmWs21jr11Eo+FT4Y8AFaCImQ0ux/DGfvhBwy1fPu579sWjiNg5LPYip E29hd0pjwjUeCbHrrr+Csr1vvr242ts3DVY3PtwEsWBydvMTNwLgFVuLzhnAQpG+EbXC 4Rp1jBoafvhxpvZV2wT2Ld689L/NCw6ni3QIhc55KZlMJ+JQ5Bvv0OwpPH+KG4XNjaSC hMcQ== X-Gm-Message-State: AC+VfDzA88eMkBz2RKqAtFNTX8bYgwkL9aZHZN8GcdjDSQ1wUp1nfEvX iBlny4yAqET7UZB6KziG0lLqc+jIr0oz8ScYjSwqZA== X-Google-Smtp-Source: ACHHUZ4uk8bXc0aKlBqcwjga8CcX6Vl5m8NuyHlyB9RvWG/Pls31VXNzC85ucrxNZSZGg26xyddRjg== X-Received: by 2002:a05:6000:12cd:b0:30a:eada:8b9b with SMTP id l13-20020a05600012cd00b0030aeada8b9bmr11343950wrx.41.1686816278222; Thu, 15 Jun 2023 01:04:38 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id i4-20020a5d5584000000b0030fc576633dsm9576465wrv.16.2023.06.15.01.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 01:04:37 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix wrong code for ACATS cd1c03i on Morello target Date: Thu, 15 Jun 2023 10:04:36 +0200 Message-Id: <20230615080436.940392-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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,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: From: Eric Botcazou gcc/ada/ * gcc-interface/utils2.cc (build_binary_op) : Do not remove a VIEW_CONVERT_EXPR on the LHS if it is also on the RHS. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils2.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index e1737724b65..95bbce2f1b4 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -878,7 +878,8 @@ build_binary_op (enum tree_code op_code, tree result_type, them; we'll be putting them back below if needed. Likewise for conversions between record types, except for justified modular types. But don't do this if the right operand is not BLKmode (for packed - arrays) unless we are not changing the mode. */ + arrays) unless we are not changing the mode, or if both ooperands + are view conversions to the same type. */ while ((CONVERT_EXPR_P (left_operand) || TREE_CODE (left_operand) == VIEW_CONVERT_EXPR) && (((INTEGRAL_TYPE_P (left_type) @@ -890,7 +891,10 @@ build_binary_op (enum tree_code op_code, tree result_type, && TREE_CODE (operand_type (left_operand)) == RECORD_TYPE && (TYPE_MODE (right_type) == BLKmode || TYPE_MODE (left_type) - == TYPE_MODE (operand_type (left_operand)))))) + == TYPE_MODE (operand_type (left_operand))) + && !(TREE_CODE (left_operand) == VIEW_CONVERT_EXPR + && TREE_CODE (right_operand) == VIEW_CONVERT_EXPR + && left_type == right_type)))) { left_operand = TREE_OPERAND (left_operand, 0); left_type = TREE_TYPE (left_operand); -- 2.40.0