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 38938387093F for ; Thu, 28 Sep 2023 17:26:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38938387093F 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=1695921994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GNzy4VoOiUkCy2xaInqY17mi49lNmw66dIACxAhtKc4=; b=ddwnV5LYYWUK/80Yx/yUswfJcRf52CDxRZroFVbEVVX8+r43BTC8Jg09kTipbDaUEoPJvE ceX4ieWpu1XHvhS+o6msas6XTRI8fYoqMm5jLB2JJB32jLs1gAZQHWDDo7sKsxPCRG9Uws XnAppb2S5q8vjOiAf3nt04cegf7TnOc= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-NYQje-mSPeO4laBQp181sg-1; Thu, 28 Sep 2023 13:26:33 -0400 X-MC-Unique: NYQje-mSPeO4laBQp181sg-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-417fa4c2824so200618421cf.3 for ; Thu, 28 Sep 2023 10:26:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695921992; x=1696526792; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GNzy4VoOiUkCy2xaInqY17mi49lNmw66dIACxAhtKc4=; b=lG9GpJVxdlvFcMC4+Ul3EC0yhw0aPoq2eolmFoURQOy1db0ITSi2kASWszPvCUn4tN l9k5kHBiCLIlAQgPmzwiAJFNA0kXa4Y1jS06IowxT3jAmNQz76023EDjV+9Oz+ftIH1i emgaakA2wnC8lP5QuSFciSdDCg1/+ik7iaV+Ik9zk6KWWvqTrtMpI15r/0Vg8Com1NFT 0gOj/QDY7yinTArbL4AVZaJ9M4DLBWR+CiLsoTQZYXUfPZdRATWgFfjaD0PF4Ih6nQeT I7eR1d77eqgdOmscEjwMUr+7VoKM2njk2zf5Z3aNwVI9zmdzaFh9jEi9fmdfSndKAfVm ZKXA== X-Gm-Message-State: AOJu0Yxu1XGp7mh9U+y/qPElxR5k442MlD42sdDIXgsTTQ4TOfDtxwp5 R3G9G7N+vdsPULNW4Fs1c0Uf7Txjqg6NtQOE8dncMhgNy48eihaonqA4UbLvoiM+BFxskH3qQlv w5WdehajfSvYOJaKDnl8XiHnG6It4bEbddyYGH4slhVGT/OkaqTSJgHRX5Xc21gPf6pTGcklshg == X-Received: by 2002:a05:622a:148c:b0:418:d18:56ae with SMTP id t12-20020a05622a148c00b004180d1856aemr2082130qtx.25.1695921992542; Thu, 28 Sep 2023 10:26:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0OfSfCnfYFDXtwYRpjPcW8z0BYBr4875JF7UCFQP63bx0ZsR91h0rsAz1mT11+gfZrzrieg== X-Received: by 2002:a05:622a:148c:b0:418:d18:56ae with SMTP id t12-20020a05622a148c00b004180d1856aemr2082111qtx.25.1695921992172; Thu, 28 Sep 2023 10:26:32 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id x30-20020ac84d5e000000b0041818df8a0dsm3238528qtv.36.2023.09.28.10.26.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Sep 2023 10:26:31 -0700 (PDT) Message-ID: <8673fdfc-4b16-ff4a-8906-c47403cde825@redhat.com> Date: Thu, 28 Sep 2023 13:26:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] Remove poly_int_pod To: gcc-patches@gcc.gnu.org, jakub@redhat.com, richard.sandiford@arm.com References: 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: 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,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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/28/23 05:55, Richard Sandiford wrote: > poly_int was written before the switch to C++11 and so couldn't > use explicit default constructors. This led to an awkward split > between poly_int_pod and poly_int. poly_int simply inherited from > poly_int_pod and added constructors, with the argumentless constructor > having an empty body. But inheritance meant that poly_int had to > repeat the assignment operators from poly_int_pod (again, no C++11, > so no "using" to inherit base-class implementations). > > All that goes away if we switch to using default constructors. > > The main complication is ensuring that braced initialisation still > gives a constexpr, so that static variables can be initialised without > runtime code. The two problems here are: > > (1) When initialising a poly_int with fewer than N > coefficients, the other coefficients need to be a zero of > the same precision as the explicit coefficients. This was > previously done in a for loop using wi::ints_for<...>::zero, > but C++11 constexpr constructors can't have function bodies. > The patch instead uses a series of delegated initialisers to > fill in the implicit coefficients. Perhaps it's time to update the bootstrap requirement to C++14 (i.e. GCC 5, from eight years ago). Not that this would affect this particular patch. Jason