public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Jason Merrill <jason@redhat.com>,
	gcc-patches@gcc.gnu.org, jakub@redhat.com,
	richard.sandiford@arm.com
Subject: Re: [PATCH] Remove poly_int_pod
Date: Thu, 28 Sep 2023 13:09:37 -0600	[thread overview]
Message-ID: <3e29a0ea-b143-4128-92bf-40f6fc01762b@gmail.com> (raw)
In-Reply-To: <8673fdfc-4b16-ff4a-8906-c47403cde825@redhat.com>



On 9/28/23 11:26, Jason Merrill wrote:
> 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<N, wide_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.
IIRC the primary reason we settled on gcc-4.8.x was RHEL7/Centos7.  With 
RHEL 7 approaching EOL moving the baseline forward would seem to make sense.

I'd want to know if this affects folks using SuSE's enterprise distro 
before actually making the change, but I'm broadly in favor of moving 
forward it it's not going to have a major impact on users that are using 
enterprise distros.

jeff

  reply	other threads:[~2023-09-28 19:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  9:55 Richard Sandiford
2023-09-28 14:06 ` Jakub Jelinek
2023-09-28 17:26 ` Jason Merrill
2023-09-28 19:09   ` Jeff Law [this message]
2023-09-29  6:31     ` Richard Biener
2023-09-29  8:14       ` Jakub Jelinek
2023-10-02  7:47 ` Jan-Benedict Glaw
2023-10-02  7:50   ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e29a0ea-b143-4128-92bf-40f6fc01762b@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).