From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 0C2283858408 for ; Thu, 6 Jan 2022 20:00:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C2283858408 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1n5Yva-0001r6-Bq for fortran@gcc.gnu.org; Thu, 06 Jan 2022 21:00:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: fortran@gcc.gnu.org From: Harald Anlauf Subject: Re: [PATCH] PR fortran/103777 - ICE in gfc_simplify_maskl, at fortran/simplify.c:4918 Date: Thu, 6 Jan 2022 20:50:33 +0100 Message-ID: <978d4418-780e-dae1-a51c-62af41be301b@gmx.de> References: <6610f3ca-3aa1-834d-ac20-c7a667b11bc8@orange.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-US In-Reply-To: <6610f3ca-3aa1-834d-ac20-c7a667b11bc8@orange.fr> Cc: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 06 Jan 2022 20:00:06 -0000 Message-ID: <20220106195033.C-0iY-qTLf_LjW3Y8J6AZSWeHU5yStaYVXGNZtXXHa4@z> Hi Mikael, Am 21.12.21 um 13:38 schrieb Mikael Morin: > Le 20/12/2021 à 23:05, Harald Anlauf via Fortran a écrit : >> Dear all, >> >> we need to check the arguments of the elemental MASKL and MASKR >> intrinsics also before simplifying. >> >> Testcase by Gerhard.  The fix is almost obvious, but I'm happy to >> get feedback in case there is something I overlooked.  (There is >> already a check on scalar arguments to MASKL/MASKR, which however >> misses the case of array arguments.) >> >> Regtested on x86_64-pc-linux-gnu.  OK for mainline? >> > Your patch looks reasonable and safe. > However, I find it surprising that it’s actually needed, as gfc_check > mask is already the check function associated to maskl and maskr in the > definition of the symbols.  The simplification function should be called > only when the associated check function has returned successfully, so it > shouldn’t be necessary to call it again at simplification time. > Looking at the backtrace, it is the do_simplify call at the beginning of >  gfc_intrinsic_func_interface that seems dubious to me, as it comes > before all the check further down in the function and it looks redundant > with the other simplification code after the checks. > > So I’m inclined to test whether by any chance removing that call works, > and if it doesn’t, let’s go with this patch. Did you find the time to try your version? > Mikael > Thanks, Harald