From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id ED6963857B8D for ; Fri, 23 Sep 2022 14:31:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED6963857B8D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x529.google.com with SMTP id m3so436311eda.12 for ; Fri, 23 Sep 2022 07:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=v7PGgbbrUGNZMrJldw0RD76z5LUVJ8lkTao/ixOB+T4=; b=G/Sk0keWB+rkXbLEKfMa5Pby7+peB3DaV9bvyB+4tubjSUjYKgzBd36tPS59OXuEV3 5ewmsTY0e38iDpAqLAuG1vcagu8X0TuNtLfBPA/BsFmkOXESiq+bch92d3YwfNVZZ7tu k57TkiLPse6e8z97kp5FdI8RyBGlCDyINrZtDZ+O4zd0Je2nTxz5eQFVoYfIYkvlYnAX Fo7Oq8DRT7PNTZnO5+Qxq6qj0w0Rh7DVvZbIr/5sqieoWTw7fZZlP0aHSmEpl1CB94Yw TY+mJiffh+8syfg1dWeidkAMzNzMyCQD/dz8D9soKi72HC5gpkRzvvuM+UcMXDrq4H9U SKSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=v7PGgbbrUGNZMrJldw0RD76z5LUVJ8lkTao/ixOB+T4=; b=JI7j/85MtpylMaezWYxFNqvXbOiKHF47gtWRit3DTXM3inMQRmoJRo1mA6xP0Ezlb/ /Jo5Vt7Z9ekQwskOKy1Ww3NzQtdgmMkwqBg49iLjjj9coKcU0zZii5Urkj7HHLR7lNzJ TXh6kFcAlw6UGtNN725BIORCxPgl2ieDxbZIHfaNYHxGIirCkwuNna9Sq+ol7F3eZsm+ ZtiWkRdFmwbo1XpKxs1ONLgXepoc6AaFch43lJL5IplUresKNvpI0hq8xSQyTvqfJQ0I bkAVQmV3JibEZBq3EHAb0krU38+NjDqUEVLzOD/T20mx+ChO2uzJzuy9K/vR9bpfWGQR VOCg== X-Gm-Message-State: ACrzQf1x0hImBeAKjgkNdjK2C5GfpREol1jeDGGC/5egDzVExMIvu3eD ws04c83KdyoczPGyj+zFKo0Jsgi4Q30AN3PSpp0= X-Google-Smtp-Source: AMsMyM5v5jCYpZsUuuFc2yJ6m5OPmztIfn1ofP3bUBzqeDqxHZIbwMVD1WyvHXsVdguxlyso+k8B+wVQbdRxKpgwryI= X-Received: by 2002:aa7:c707:0:b0:44e:5193:1b0f with SMTP id i7-20020aa7c707000000b0044e51931b0fmr8633204edq.238.1663943464720; Fri, 23 Sep 2022 07:31:04 -0700 (PDT) MIME-Version: 1.0 References: <88e489d8-4248-75de-6e8e-af6f152da61b@in.tum.de> In-Reply-To: From: David Edelsohn Date: Fri, 23 Sep 2022 10:30:45 -0400 Message-ID: Subject: Re: [PATCH] Avoid depending on destructor order To: Thomas Neumann Cc: Jason Merrill , GCC Patches Content-Type: multipart/alternative; boundary="000000000000241b8305e959071c" X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: --000000000000241b8305e959071c Content-Type: text/plain; charset="UTF-8" On Fri, Sep 23, 2022 at 10:12 AM Thomas Neumann wrote: > > > > +static const bool in_shutdown = false; > > > > I'll let Jason or others decide if this is the right solution. It seems > > that in_shutdown also could be declared outside the #ifdef and > > initialized as "false". > > sure, either is fine. Moving it outside the #ifdef wastes one byte in > the executable (while the compiler can eliminate the const), but it does > not really matter. > > I have verified that the patch below fixes builds for both fast-path and > non-fast-path builds. But if you prefer I will move the in_shutdown > definition instead. > > Best > > Thomas > > PS: in_shutdown is an int here instead of a bool because non-fast-path > builds do not include stdbool. Not a good reason, of course, but I > wanted to keep the patch minimal and it makes no difference in practice. > > > When using the atomic fast path deregistering can fail during > program shutdown if the lookup structures are already destroyed. > The assert in __deregister_frame_info_bases takes that into > account. In the non-fast-path case however is not aware of > program shutdown, which caused a compiler error on such platforms. > We fix that by introducing a constant for in_shutdown in > non-fast-path builds. > > libgcc/ChangeLog: > * unwind-dw2-fde.c: Introduce a constant for in_shutdown > for the non-fast-path case. > > diff --git a/libgcc/unwind-dw2-fde.c b/libgcc/unwind-dw2-fde.c > index d237179f4ea..0bcd5061d76 100644 > --- a/libgcc/unwind-dw2-fde.c > +++ b/libgcc/unwind-dw2-fde.c > @@ -67,6 +67,8 @@ static void > init_object (struct object *ob); > > #else > +/* Without fast path frame deregistration must always succeed. */ > +static const int in_shutdown = 0; > > /* The unseen_objects list contains objects that have been registered > but not yet categorized in any way. The seen_objects list has had > Thanks for the patch. I'll let you and Jason decide which style solution is preferred. Thanks, David --000000000000241b8305e959071c--