From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp04.smtpout.orange.fr [80.12.242.126]) by sourceware.org (Postfix) with ESMTPS id 389A23858C20 for ; Mon, 22 Aug 2022 09:52:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 389A23858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([83.205.188.89]) by smtp.orange.fr with ESMTPA id Q46sojp7bGYmzQ472op6kp; Mon, 22 Aug 2022 11:52:52 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Mon, 22 Aug 2022 11:52:52 +0200 X-ME-IP: 83.205.188.89 Message-ID: <426b9ffe-93af-b961-26d5-8632cd885666@orange.fr> Date: Mon, 22 Aug 2022 11:52:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH] Fortran: fix simplification of intrinsics IBCLR and IBSET [PR106557] To: Harald Anlauf , fortran , gcc-patches References: Content-Language: fr From: Mikael Morin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, FREEMAIL_FROM, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2022 09:52:55 -0000 Le 20/08/2022 à 21:11, Harald Anlauf via Fortran a écrit : > Dear all, > > the simplification of the TRANSFER intrinsic produces a > redundant representation of the result, one in expr->value > and another in expr->representation.string. This is done > to ensure a safe "round-trip" for nested TRANSFER. > > In a subsequent use of this result we either need to make > sure that both parts stay consistent, or drop the latter > part. > > The simplifications of IBCLR and IBSET do a gfc_copy_expr > of their argument x and modify only the former part. > Depending on context, either value.integer or > representation.string (if non-NULL) are used later, > leading to surprising results. > > A conservative approach to fix this PR is to simply > drop the unneeded representation.string in the > simplification of the intrinsics IBCLR and IBSET, > see attached patch. (A quick glance did not turn up > other intrinsics affected the same way.) > > Regtested on x86_64-pc-linux-gnu. OK for mainline? > Yes, thanks.