From patchwork Mon May 2 05:11:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1624953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fRPdwPB3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KsB6b4qRkz9s0w for ; Mon, 2 May 2022 15:12:22 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B34FF385842B for ; Mon, 2 May 2022 05:12:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B34FF385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1651468339; bh=VO5feN2IHBmkuKHqHB0NunAECAXvJ2AsIpfP9KvJiv8=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fRPdwPB3rS6eWuPaz+vagEGJbhInIfdSPFeOka/M6ytDOpjJCl0/uDUIITcNaR+Yi mOavAUewS3I/6qZadJhsqwCIsV66PZAJQRddNrtc2dMsTgkCMpiY69qruKo/TSgNsy ayy16YNSJ19TsbcuZRpwqcPdhdmSbwyCKo8P+6F8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 8AB9E3858D3C for ; Mon, 2 May 2022 05:12:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8AB9E3858D3C Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-7voz6wnVNbCKnyu48P_QxA-1; Mon, 02 May 2022 01:11:58 -0400 X-MC-Unique: 7voz6wnVNbCKnyu48P_QxA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E42D811E75; Mon, 2 May 2022 05:11:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 497F514A5697; Mon, 2 May 2022 05:11:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 2425BtLB3996046 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 2 May 2022 07:11:56 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 2425BsWd3996045; Mon, 2 May 2022 07:11:54 +0200 Date: Mon, 2 May 2022 07:11:54 +0200 To: Richard Biener , Jonathan Wakely Subject: [committed] system.h: Include in system.h unconditionally Message-ID: References: <92C6EA36-CA62-4E3E-B7B5-5E1C06A44E70@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Iain Sandoe Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" On Sun, May 01, 2022 at 07:06:53PM +0100, Jonathan Wakely wrote: > > >> the reason is that "gcc/analyzer/region-model.cc” uses initializer_lists, and it seems that > > >> is not transitively included by any used headers for _LIBCPP_VERSION < 4000. I fixed that locally by > > >> adding initializer_list into system.h (and adding INCLUDE_INITIALIZER_LIST to the top of gcc/analyzer/region-model.cc) > > >> - with that change those versions do bootstrap and test OK*** > > > > > > From what I can see, with libstdc++ it works because which is > > > included by system.h includes . > > > If I rename initializer_list in analyzer/region-model.ii to initializer_listx, I > > > also get: > > > ../../gcc/analyzer/region-model.cc: In function ‘void ana::selftest::test_binop_svalue_folding()’: > > > ../../gcc/analyzer/region-model.cc:4966:48: error: deducing from brace-enclosed initializer list requires ‘#include ’ > > > 4508 | > > > +++ |+#include > > > 4509 | static void > > > ...... > > > 4966 | for (auto op : {BIT_IOR_EXPR, TRUTH_OR_EXPR}) > > > | ^ > > > ../../gcc/analyzer/region-model.cc:4978:49: error: deducing from brace-enclosed initializer list requires ‘#include ’ > > > 4978 | for (auto op : {BIT_AND_EXPR, TRUTH_AND_EXPR}) > > > | ^ > > > > > > I think we have 2 options, one is do what you wrote above, > > > INCLUDE_INITIALIZER_LIST defined before system.h to get #include . > > > The other option is just to include that unconditionally, it is a very small > > > header. For libstdc++ it will make no difference as it is included anyway > > > and the header is really small there, libc++ includes which isn't > > > normally included and system.h includes instead. > > > > I’d say unconditionally would be OK. I suppose the chance that any host > > C++ is good enough to build GCC as-is but fails to provide > > is zero? > > > > Yes, definitely. > > > I’d be OK to do this change without a new RC even. I've bootstrapped/regtested this on 12 branch on x86_64-linux and i686-linux, committed to both. 2022-05-02 Jakub Jelinek * system.h: Include initializer_list. Jakub --- gcc/system.h.jj 2022-04-28 15:56:06.786792094 +0200 +++ gcc/system.h 2022-05-01 20:23:04.373273340 +0200 @@ -239,6 +239,7 @@ extern int errno; # include #endif # include +# include # include # include # include