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 AF1B83858418 for ; Mon, 10 Jan 2022 19:02:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF1B83858418 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644--2wQzCSPN9C9TrKV7Vh6YA-1; Mon, 10 Jan 2022 14:02:12 -0500 X-MC-Unique: -2wQzCSPN9C9TrKV7Vh6YA-1 Received: by mail-qt1-f197.google.com with SMTP id l4-20020ac84584000000b002c5ede470a7so6702223qtn.7 for ; Mon, 10 Jan 2022 11:02:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=uuRgOOxxPeZZbm/HEjM2o1BhPK4GVfxoCnWBhpEEMXE=; b=rMjywLlif8o0tFm+OrOGlFHz5UDMP5ISC9R2T9ZEsTqSbdbm8H5QE/AmXHhnfcFw2Q tUyCoQsYFoyQZ9IknvMJui6RkzXX+18nb/g8cfO/fGrMK4vD4RyuL52qR4jxixZJJ0kV W5ucxrEff9ifVEdeHjWJBnbZoTmpFF1D9ok4UEsOCDCbaiDGrYUqE9x5KR4u+Cmg1yE4 arMxfcJxSNk3okchVM2QX82TnxxkG9joySlPrZzm9b2ReFjzDs3At2GJYy/Nxf0W++HP 1hBrgsk7ZS7zd3GkMbZ/5IlPphflQ4OS8G2Y7Gjk/UOMZ5VYNZ/CoX4WtMh85UTHhf3n CpaA== X-Gm-Message-State: AOAM531TgtnFfl/lRAyaG7exuSwJ9NJWjCy91uvKL5nFjzI4+iMJqvBy 2Wg8AyMdX93YL9dRfsWBNlo91w6oj7SKIg8OLaivjxdmK4DcAA3J3b+QNdOVV2UudhH+dBr/E1W GuvU8AO9mgsj+afjpqw== X-Received: by 2002:a05:6214:4110:: with SMTP id kc16mr751335qvb.49.1641841331776; Mon, 10 Jan 2022 11:02:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJv4vHU9TsxpEtTQvqKX9kMIEwQqwbpoVVOpZs2E89htZUmf1HIMcyccIlMr8gyfCSdGbAag== X-Received: by 2002:a05:6214:4110:: with SMTP id kc16mr751293qvb.49.1641841331386; Mon, 10 Jan 2022 11:02:11 -0800 (PST) Received: from [192.168.1.149] (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 e14sm4890827qts.15.2022.01.10.11.02.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jan 2022 11:02:10 -0800 (PST) Message-ID: Date: Mon, 10 Jan 2022 14:02:10 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] Improve sequence logic in cxx_init_decl_processing To: Olivier Hainque , gcc-patches Cc: Rasmus Villemoes References: <5A7D4F1E-B0ED-48F0-B94B-6A355C46730E@adacore.com> From: Jason Merrill In-Reply-To: <5A7D4F1E-B0ED-48F0-B94B-6A355C46730E@adacore.com> 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: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Mon, 10 Jan 2022 19:02:16 -0000 On 1/6/22 03:26, Olivier Hainque wrote: > Hello, > > commit aa2c978400f3b3ca6e9f2d18598a379589e77ba0, introduced per > > https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545552.html > > makes references to __cxa_pure_virtual weak and this is causing > issues on some VxWorks configurations, where weak symbols are only > supported for one of the two major operating modes, and not on all > versions. > > While trying to circumvent that, I noticed that the current > code in cxx_init_decl_processing does something like: > > if (flag_weak) > /* If no definition is available, resolve references to NULL. */ > declare_weak (abort_fndecl); > ... > if (! supports_one_only ()) > flag_weak = 0; > > > The code possibly resetting flag_weak should presumlably execute > before the test checking the flag, or we'd need a comment explaining > why this surprising order is on purpose. > > The attached patch just moves the reset above the test. > > It bootstraps/regtests fine on x86_64-linux and allows better control > on vxWorks. I'm not yet clear on some of the ramifications there (tigthening > the definitions of SUPPORTS_ONE_ONLY and TARGET_SUPPORTS_WEAK yields lots of > dg test failures) but that's another story. > > Ok to commit? OK. > Thanks in advance! > > 2021-12-30 Olivier Hainque > > gcc/ > * cp/decl.c (cxx_init_decl_processing): Move code possibly > altering flag_weak before code testing it. > > Olivier > > > > >