From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 2EDED38346B0 for ; Tue, 10 May 2022 08:21:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2EDED38346B0 Received: by mail-wr1-x42f.google.com with SMTP id u3so22676254wrg.3 for ; Tue, 10 May 2022 01:21:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=bgQ1gbBOWNW5jOlGP49k/7S8zcZ+u1TbCfky9KqclTs=; b=J/OuTpULFp8ZmEsbBhBZHJ897t8t0gx6OD/lYyE9Crn/N9v1gvHpLtsLhXWU/v4rOR Eoq5YAtUU3HLNAfTbf0Bk/OTXLzfaET9MWhPTst54Fni2I0AqkY6y//rySeVbyZQTv55 9mizT6pZum2UNuM8ivQ/S9fBzB+br3b2PXt1Oyx1daDxzyFPnbSGHRPTHDxWIgUkkyoq hGuhtd978ZTaszcxA3I3cdSCmZXGu8+0vC0QYdF4cisv4K8p07HeHPQFO/dUnOkI84No kjQ0N0iueo4lZoYJhlJaYs8m94+5IPi8Ef5sUjJCDsgntrppBZQ1TMpwvVuTI6b06byE ZeGg== X-Gm-Message-State: AOAM532TLoVznpecOb/JsVBp4L0V/+U/2dqzZq/P9CEeUp//8RX8yIGC Cfw9dpTvHXMNdDmBkJnuVKUBKCy3pmvVMw== X-Google-Smtp-Source: ABdhPJzEOsDznZpZMYfZ4BevqXuRASpNVnnzEl5br9d0j7WpOcm/iqEphJIfXVMdQZe75WGVc19OVA== X-Received: by 2002:a5d:58e3:0:b0:20c:d508:43d4 with SMTP id f3-20020a5d58e3000000b0020cd50843d4mr2596594wrd.51.1652170873956; Tue, 10 May 2022 01:21:13 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id n19-20020a05600c4f9300b003942a244ee1sm1801714wmq.38.2022.05.10.01.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 01:21:13 -0700 (PDT) Date: Tue, 10 May 2022 08:21:13 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Alexandre Oliva Subject: [Ada] Handle non-standard booleans in if_expression condition Message-ID: <20220510082113.GA3029332@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline X-Spam-Status: No, score=-13.2 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-List-Received-Date: Tue, 10 May 2022 08:21:23 -0000 --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline We failed to call Adjust_Condition for the condition expression of an if_expression, so non-standard booleans were expanded like standard booleans, disregarding representation clauses. Fixed. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_If_Expression): Call Adjust_Condition to handle non-standard booleans. --wRRV7LY7NUeQGEoC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -5794,6 +5794,10 @@ package body Exp_Ch4 is -- Start of processing for Expand_N_If_Expression begin + -- Deal with non-standard booleans + + Adjust_Condition (Cond); + -- Check for MINIMIZED/ELIMINATED overflow mode. -- Apply_Arithmetic_Overflow_Check will not deal with Then/Else_Actions -- so skip this step if any actions are present. --wRRV7LY7NUeQGEoC--