From patchwork Mon Jun 17 07:37:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 1116736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503049-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="oi+75/AT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45S32y4TPpz9s3l for ; Mon, 17 Jun 2019 17:37:39 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=WvmgQJV0oYRdE0RQRN+zAt7/XjNrI3JaCYUOPOlDac8hPuYKat sQiPkNXGS4zIR9iw7VUBVl2pd5SH/yYciY+YnvWkffocobUU0xiCAITQzzZO+ius R7keaABbUiyqyDnKfAU5925yFoOzKV2w/3eQiMh0Ak5bYN9NW7WSlkNv4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=8JPA8JGsu0jmnZ46FIpq/uf3Mps=; b=oi+75/ATu3qbK2ClTUo+ trC60IzENrPZy4q2F9vg8bzPpNtwpVfVEsIc3PvGOP8OZ7ujgbYYEnJ8TaSJcNKP /wjzad5lS4SwQ5HmgdpCJjHJTq0nLF6NDOOUmwylkyC5afW41tM1wFHZaPgly7gC 8/8UM+NQKFe43n/ab3B3F3g= Received: (qmail 119036 invoked by alias); 17 Jun 2019 07:37:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 119019 invoked by uid 89); 17 Jun 2019 07:37:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Rewrite 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; Mon, 17 Jun 2019 07:37:30 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7F65056058; Mon, 17 Jun 2019 03:37:28 -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 WrM9ymGOeIGs; Mon, 17 Jun 2019 03:37:28 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 6DF0656057; Mon, 17 Jun 2019 03:37:28 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 673705EC; Mon, 17 Jun 2019 03:37:28 -0400 (EDT) Date: Mon, 17 Jun 2019 03:37:28 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: vries@gcc.gnu.org Subject: [Ada] Workaround for PR ada/80590 Message-ID: <20190617073728.GA31485@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) This patch avoids an unnecessary exception propagation in the compiler when handling the "delay" construct. This should avoid the crashes/hangs observed in PR 80590 on g-exptty.adb among others. Note that the proper fix for this PR is to do a full bootstrap of GCC, since the issue is that GNAT switched from SJLJ to ZCX exception handling from GCC 7 to GCC 8, causing these inconsistencies that can only be resolved via a full bootstrap, or by using the newly built compiler to build new compilers. Tested on x86_64-pc-linux-gnu Verified manually that no exception propagation occurs in gnat1 with this patch when compiling g-exptty.adb, g-locfil.adb, s-gloloc.adb and g-socthi.adb. Tom, if you could confirm that you are unblocked and can move forward on reenabling Ada on your builds, that'd be great, let me know. Committed on branches 8, 9 and trunk. 2019-06-17 Arnaud Charlet PR ada/80590 * exp_ch9.adb (Expand_N_Delay_Relative_Statement): Swap the two conditions to avoid a unnecessary exception propagation in the default case. Index: exp_ch9.adb =================================================================== --- exp_ch9.adb (revision 272370) +++ exp_ch9.adb (working copy) @@ -8258,18 +8258,17 @@ Proc : Entity_Id; begin - -- Try to use System.Relative_Delays.Delay_For only if available. This - -- is the implementation used on restricted platforms when Ada.Calendar - -- is not available. + -- Try to use Ada.Calendar.Delays.Delay_For if available. - if RTE_Available (RO_RD_Delay_For) then - Proc := RTE (RO_RD_Delay_For); + if RTE_Available (RO_CA_Delay_For) then + Proc := RTE (RO_CA_Delay_For); - -- Otherwise, use Ada.Calendar.Delays.Delay_For and emit an error - -- message if not available. + -- Otherwise, use System.Relative_Delays.Delay_For and emit an error + -- message if not available. This is the implementation used on + -- restricted platforms when Ada.Calendar is not available. else - Proc := RTE (RO_CA_Delay_For); + Proc := RTE (RO_RD_Delay_For); end if; Rewrite (N,