From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp02.smtpout.orange.fr [80.12.242.124]) by sourceware.org (Postfix) with ESMTPS id B879F385840A for ; Fri, 5 Nov 2021 21:28:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B879F385840A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([92.167.144.168]) by smtp.orange.fr with ESMTPA id j6l7mg5bhBazoj6l8m7YWq; Fri, 05 Nov 2021 22:28:26 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: MDU4MTIxYWM4YWI0ZGE4ZTUwZWZmNTExZmI2ZWZlMThkM2ZhYiE5OWRkOGM= X-ME-Date: Fri, 05 Nov 2021 22:28:26 +0100 X-ME-IP: 92.167.144.168 Subject: Re: [PATCH] PR fortran/102817 - [12 Regression] ICE in gfc_clear_shape, at fortran/expr.c:422 To: Harald Anlauf , fortran , gcc-patches References: From: Mikael Morin Message-ID: <13745c16-5a58-959a-62cd-3552985d066e@orange.fr> Date: Fri, 5 Nov 2021 22:28:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: Fri, 05 Nov 2021 21:28:29 -0000 Le 01/11/2021 à 22:39, Harald Anlauf via Fortran a écrit : > Dear Fortranners, > > a recent patch uncovered a latent issue with simplification of > array-valued expressions where the resulting shape was not set > from the referenced subobject. Once found, the fix looks obvious. > > Regtested on x86_64-pc-linux-gnu. OK? > Hello, > diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c > index 4dea840e348..c5360dfaede 100644 > --- a/gcc/fortran/expr.c > +++ b/gcc/fortran/expr.c > @@ -2129,6 +2129,7 @@ simplify_parameter_variable (gfc_expr *p, int type) > return false; > > e->rank = p->rank; > + e->shape = gfc_copy_shape (p->shape, p->rank); > I think e->shape can be non-null, and should be freed beforehand. Ok with that change. Mikael