From patchwork Tue Nov 9 09:46:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 47263 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBAC3385801F for ; Tue, 9 Nov 2021 10:08:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBAC3385801F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636452526; bh=lm+7W23wq/1HeylYxyGjShvveXq3YAeGo0AKBUnXZxY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=m2O2pS17nXBJVHBMG5QGa2MvGXQPMrscC++tqvQvc4gH5iZOmUsYEKeQbDcHLrpL5 /eUY9U1JJoYVhcnFFYtmwVCj90zM9eBTkVf0RhGmoFG4hahzcI7DXenmN2hX/HRidS qSKMDQr7nL5zN7PjGvQh/uf+vEaUuguJyPPcbgRY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 7A2E43858C2C for ; Tue, 9 Nov 2021 09:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A2E43858C2C Received: by mail-lf1-x130.google.com with SMTP id k37so209259lfv.3 for ; Tue, 09 Nov 2021 01:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=lm+7W23wq/1HeylYxyGjShvveXq3YAeGo0AKBUnXZxY=; b=vZTqbj+UhbLCe4XVaJWPd8lUA+lL2pFkHwQU/v5cwLzAzhJ3lV71wXrcqdhJrFvNBh HaggcXKBbd6pDmls28fkm1/v6pZwwO2uXO1ckLU3OozgiX00yfB6fu+K4Q0i7r4zYoFK fiJz+8ixBrX+MDrc+VlhVqIYvrg4QMU5ND5TqdXyDrojQxegia0UWakEJTwy+CqpTMhb f+mfgKMBx6StccOT1CDnXOTJKOFRRx4lU8WGSLswDtw2xHixYOm6iezL07swLjKHrFoC lfDYMiIAo5bqxQ/1E5LqXml4e3PBZyUwaNR7jIhnY4W8nlOgWacV8i9Aft2aBTvJ1ari hN2Q== X-Gm-Message-State: AOAM530TOulBM03V74VaHhiKT25VG1BbLm6bW2PmxvVJw/AG5jIM9ZDU VLqWBMIUC/5/ZpxqvbQxpTOSan4VxrIChw== X-Google-Smtp-Source: ABdhPJz+QARBWFdCjLskbczi9BZyRwkuX8igf2ah3r3SIMfNCunG3g7wq2u8QIckUwNvemc0Y2WQRg== X-Received: by 2002:a05:6512:2288:: with SMTP id f8mr5774253lfu.368.1636451182368; Tue, 09 Nov 2021 01:46:22 -0800 (PST) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id i13sm2083192lfb.45.2021.11.09.01.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 01:46:21 -0800 (PST) Date: Tue, 9 Nov 2021 09:46:20 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Do not indicate a pending abort if the task is already aborting Message-ID: <20211109094620.GA830973@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Patrick Bernardi Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Check_Abort_Status would return the equivalent of True while a task was in the process of aborting causing another Abort exception to be raised and not to terminate cleanly. This only affects targets that use stack check emulation, which is currently limited to RTEMS. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/s-tasini.adb (Check_Abort_Status): Don't return 1 if the task is aborting. * libgnarl/s-tasini.ads (Check_Abort_Status): Update comment. diff --git a/gcc/ada/libgnarl/s-tasini.adb b/gcc/ada/libgnarl/s-tasini.adb --- a/gcc/ada/libgnarl/s-tasini.adb +++ b/gcc/ada/libgnarl/s-tasini.adb @@ -126,6 +126,7 @@ package body System.Tasking.Initialization is if Self_ID /= null and then Self_ID.Deferral_Level = 0 and then Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level + and then not Self_ID.Aborting then return 1; else diff --git a/gcc/ada/libgnarl/s-tasini.ads b/gcc/ada/libgnarl/s-tasini.ads --- a/gcc/ada/libgnarl/s-tasini.ads +++ b/gcc/ada/libgnarl/s-tasini.ads @@ -115,7 +115,7 @@ package System.Tasking.Initialization is function Check_Abort_Status return Integer; -- Returns Boolean'Pos (True) iff abort signal should raise - -- Standard'Abort_Signal. Only used by IRIX currently. + -- Standard'Abort_Signal. Only used by RTEMS currently. -------------------------- -- Change Base Priority --