From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0FDD33858CDA for ; Tue, 27 Sep 2022 00:17:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0FDD33858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664237874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zutn2j1nnhDXVEqblMaabe6lRdhs6u5WnPxniFtIu0M=; b=YdZBoA2K2v7Zq0Be4Al9RIDAMl6PKDRt7/jH1a7RV+XvukRqufI/mczTsjSpUuqf2t5533 SGcavlImfFXuHXyYhCw1hxoNx1brAmV5yOV5dk3XKWhluxbZ3wX8N5PyDWIpKkiblOUpwx WRxVfc4o62/CmWRDZCEu5U2JQqjK9Qk= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-358-AIDL2ahsP7usStW3fEFknA-1; Mon, 26 Sep 2022 20:17:53 -0400 X-MC-Unique: AIDL2ahsP7usStW3fEFknA-1 Received: by mail-qk1-f200.google.com with SMTP id h7-20020a05620a400700b006cebec84734so6244245qko.23 for ; Mon, 26 Sep 2022 17:17:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Zutn2j1nnhDXVEqblMaabe6lRdhs6u5WnPxniFtIu0M=; b=v289//Rk9H+l0oy/EK/M3mhfhzSFPDpPHH+colzBaKD27P00Sw26yXEooqOD7Asrf0 5cB3ok8ZWvMfzmT0OtnDVfyyCptj6UHPMJLGsC0vLzTf2zfdw8Lyalm55eAdUYX20/E7 ybnWfRuAS9D2wmNd0drnyGr1O45OjG9JKiEbL47Hp7pPwLHpe9sZhAKOxeYrEGP1U4r+ 3M68zoOerCTHh4+KB+GSJuvo/Z9AMCoq8qaCSP5vDWZyGgVGvSLi0rdyiVSCNFtFKFjH lLp0ZPpA7TRDrakg3Me2Kn4+yGRjDEbk8Jfi215f2xnxE7anAf0tFj6bs6o07r5NM+rC dZxg== X-Gm-Message-State: ACrzQf3HiJbbHdA1WPvtuio47d3/Z/rvtkHlFa9mEXNB24aYYE5e7gUe gb2cwMkLi1NZHSWCQf+T97TEdsHeZ39TCoWxcakGbViwuC6U8ph3MwkoKx5aprM0yJnIgMx7msa h5wDg8BFmZ0Ne2CnLDA== X-Received: by 2002:a05:6214:1947:b0:4aa:9e87:d032 with SMTP id q7-20020a056214194700b004aa9e87d032mr19011715qvk.114.1664237873091; Mon, 26 Sep 2022 17:17:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+0W7SUWh+W5ILTMACRt20dZtGptZ36i8a68y6uW5AWiTmdxCxkNfevPGZcSCzrR7bViiKiA== X-Received: by 2002:a05:6214:1947:b0:4aa:9e87:d032 with SMTP id q7-20020a056214194700b004aa9e87d032mr19011702qvk.114.1664237872821; Mon, 26 Sep 2022 17:17:52 -0700 (PDT) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id j26-20020ac874da000000b0034367ec57ecsm11681709qtr.9.2022.09.26.17.17.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 17:17:52 -0700 (PDT) Message-ID: <68a2b334-7c0a-d268-278e-437a7bc769ac@redhat.com> Date: Mon, 26 Sep 2022 20:17:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH] Avoid depending on destructor order To: Thomas Neumann , David Edelsohn Cc: GCC Patches References: <88e489d8-4248-75de-6e8e-af6f152da61b@in.tum.de> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: On 9/23/22 10:12, 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. Might as well go with your patch, then, adding a comment to explain why the variable is defined in two places. > 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 >