From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87374 invoked by alias); 29 Sep 2017 13:24:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 59088 invoked by uid 89); 29 Sep 2017 13:24:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=justin, Justin, identifying, hangs X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Sep 2017 13:24:01 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D55D456070; Fri, 29 Sep 2017 09:23:59 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cOVpchQ2JBEp; Fri, 29 Sep 2017 09:23:59 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id C31F956054; Fri, 29 Sep 2017 09:23:59 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id BF75B16F; Fri, 29 Sep 2017 09:23:59 -0400 (EDT) Date: Fri, 29 Sep 2017 13:24:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Justin Squirek Subject: [Ada] Compiler hangs on evaluation of use-clause within package context Message-ID: <20170929132359.GA145182@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg01945.txt.bz2 --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 438 Due to the installation order of packages within a context clause it is possible to create circularities within the Prev_Use_Clause clain. This patch corrects this issue by identifying this case through the use of an extra check. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-29 Justin Squirek * sem_ch8.adb (Analyze_Use_Package): Add sanity check to avoid circularities in the use-clause chain. --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=difs Content-length: 714 Index: sem_ch8.adb =================================================================== --- sem_ch8.adb (revision 253285) +++ sem_ch8.adb (working copy) @@ -3782,9 +3782,10 @@ -- before setting its previous use clause. if Ekind (Pack) = E_Package - and then Present (Current_Use_Clause (Pack)) - and then Current_Use_Clause (Pack) /= N - and then No (Prev_Use_Clause (N)) + and then Present (Current_Use_Clause (Pack)) + and then Current_Use_Clause (Pack) /= N + and then No (Prev_Use_Clause (N)) + and then Prev_Use_Clause (Current_Use_Clause (Pack)) /= N then Set_Prev_Use_Clause (N, Current_Use_Clause (Pack)); end if; --envbJBWh7q8WU6mo--