From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from torfep01.bell.net (simcoe207srvr.owm.bell.net [184.150.200.207]) by sourceware.org (Postfix) with ESMTP id 768C0385481B for ; Fri, 13 Nov 2020 19:03:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 768C0385481B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dave.anglin@bell.net Received: from bell.net torfep01 184.150.200.158 by torfep01.bell.net with ESMTP id <20201113190347.FETK6892.torfep01.bell.net@torspm01.bell.net> for ; Fri, 13 Nov 2020 14:03:47 -0500 Received: from [192.168.2.49] (really [67.70.16.145]) by torspm01.bell.net with ESMTP id <20201113190347.OYGV29322.torspm01.bell.net@[192.168.2.49]>; Fri, 13 Nov 2020 14:03:47 -0500 Subject: Re: [PATCH] c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single To: Jeff Law , Jakub Jelinek , Jason Merrill , Jonathan Wakely Cc: gcc-patches@gcc.gnu.org References: <20201113172945.GH3788@tucnak> From: John David Anglin Message-ID: <8a232681-5adf-41ea-53fc-e8e82136b65b@bell.net> Date: Fri, 13 Nov 2020 14:03:48 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-Analysis: v=2.3 cv=D+A51cZj c=1 sm=1 tr=0 a=ch4VMz8uGZlcRCFa+4Q1bQ==:117 a=ch4VMz8uGZlcRCFa+4Q1bQ==:17 a=IkcTkHD0fZMA:10 a=nNwsprhYR40A:10 a=20KFwNOVAAAA:8 a=FBHGMhGWAAAA:8 a=KFo6PN55Wr99_qecz6kA:9 a=QEXdDO2ut3YA:10 a=9gvnlMMaQFpL9xblJ6ne:22 X-CM-Envelope: MS4wfMUImiop/doV256YBkmWEXfssokE2/xe5YgsylXuHKiNKMhLBX4EVtvVhfq6ryXNkEySphYt5dyuktQF/R6BKFZCvA0jS3gAp3xqkf+bs+x8kYu2HhpF NfVewSm98Zjx2MDAAgX8iPI3TDenmjRO5lY35h5BIFpfzvhoH6OoG5xK9bJqkYWg7A/+xSwO/KvTeQ== X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 13 Nov 2020 19:03:49 -0000 On 2020-11-13 1:20 p.m., Jeff Law wrote: > On 11/13/20 10:29 AM, Jakub Jelinek via Gcc-patches wrote: >> Hi! >> >> The following patch predefines __STDCPP_THREADS__ macro to 1 if c++11 or >> later and thread model (e.g. printed by gcc -v) is not single. >> There are two targets not handled by this patch, those that define >> THREAD_MODEL_SPEC. In one case - QNX - it looks just like a mistake >> to me, instead of setting thread_model=posix in config.gcc it uses >> THREAD_MODEL_SPEC macro to set it unconditionally to posix. >> The other is hpux10, which uses -threads option to decide if threads >> are enabled or not, but that option isn't really passed to the compiler. >> I think that is something that really should be solved in config/pa/ >> instead, e.g. in the config/xxx/xxx-c.c targets usually set their own >> predefined macros and it could handle this, and either pass the option >> also to the compiler, or say predefine __STDCPP_THREADS__ if _DCE_THREADS >> macro is defined already (or -D_DCE_THREADS found on the command line), >> or whatever else. >> >> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? >> >> 2020-11-13 Jakub Jelinek >> >> * c-cppbuiltin.c: Include configargs.h. >> (c_cpp_builtins): For C++11 and later if THREAD_MODEL_SPEC is not >> defined, predefine __STDCPP_THREADS__ to 1 unless thread_model is >> "single". > OK.  Note that hpux10 should be considered long dead.   I wouldn't let > that get in the way of anything.  One could argue we should remove > hpux10 and earlier, leaving just hpux11. In principle, I agree.  But there are some intereactions in the header defines and I have limited time at the moment. Regards, Dave -- John David Anglin dave.anglin@bell.net