From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by sourceware.org (Postfix) with ESMTPS id 3CC9D3959C67 for ; Wed, 16 Nov 2022 11:39:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CC9D3959C67 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.197.245.49]) by smtp.orange.fr with ESMTPA id vGlNodwmn3PfJvGlToy8R9; Wed, 16 Nov 2022 12:39:36 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Wed, 16 Nov 2022 12:39:36 +0100 X-ME-IP: 83.197.245.49 Message-ID: Date: Wed, 16 Nov 2022 12:39:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] Fortran: ICE in simplification of array expression involving power [PR107680] 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=-3.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le 15/11/2022 à 21:45, Harald Anlauf via Fortran a écrit : > Dear all, > > when constant expressions involve parentheses, array constructors, > typespecs, and the power operator (**), we could fail with an ICE > during simplification in arith_power. > > Debugging of the testcase showed we call the proper type conversions > needed for the arithmetic operation, but under certain circumstances > we seem to lose the typespec on the way to the invocation of the > simplification. We then run into unhandled combinations of operand > types. > > The attached patch is likely a sort of a band-aid to the problem: > we check the operand types in arith_power, and if we see that a > conversion is (still) needed, we punt and defer the simplification. > > AFAICT this is safe. It does not address a possibly deeply > covered issue in gfortran, which was suspected when analyzing > pr107000. But as this is elusive, that may be hard to locate > and fix. > > Regtested on x86_64-pc-linux-gnu. OK for mainline? > Yes, let's go with this. Thanks for investigating.