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 CFC453858D3C for ; Sun, 16 Oct 2022 21:17:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFC453858D3C 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] ([86.215.174.255]) by smtp.orange.fr with ESMTPA id kB0Pof9PlBDYDkB0Povnhr; Sun, 16 Oct 2022 23:17:09 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Sun, 16 Oct 2022 23:17:09 +0200 X-ME-IP: 86.215.174.255 Message-ID: <01143700-424c-ba84-6e95-c8b3573741f5@orange.fr> Date: Sun, 16 Oct 2022 23:17:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH, v2] Fortran: handle bad array ctors with typespec [PR93483, , PR107216, PR107219] Content-Language: fr, en-US To: Harald Anlauf , fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org References: From: Mikael Morin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP 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: Le 15/10/2022 à 22:15, Harald Anlauf via Fortran a écrit : > Dear all, > > here is an updated version of the patch that includes suggestions > and comments by Mikael in PR93483. > > Basic new features are: > - a new enum value ARITH_NOT_REDUCED to keep track if we encountered >   an expression that was not reduced via reduce_unary/reduce_binary > - a cleanup of the related checking, resulting in more readable >   code. > - a new testcase by Mikael that exhibited a flaw in the first patch >   due to a false resolution of a symbol by premature simplification. > > Regtested again.  OK for mainline? > (...) > diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h > index 10bb098d136..7b8f0b148bd 100644 > --- a/gcc/fortran/gfortran.h > +++ b/gcc/fortran/gfortran.h > @@ -222,11 +222,12 @@ enum gfc_intrinsic_op > Assumptions are made about the numbering of the interface_op enums. */ > #define GFC_INTRINSIC_OPS GFC_INTRINSIC_END > > -/* Arithmetic results. */ > +/* Arithmetic results. ARITH_NOT_REDUCED is used to keep track of failed > + reductions because an erroneous expression was encountered. */ The expressions are not always erroneous. They can be, but in the testcase for example, all the expressions are valid. They are just unsupported by the arithmetic evaluation code which works only with literal constants and arrays of literal constants (and arrays of arrays etc). OK with that comment fixed. Thanks.