Re: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Jonathan Wakely
On Fri, 14 Feb 2025, 18:34 Andrew Pinski (QUIC), wrote: > > -Original Message- > > From: Jonathan Wakely > > Sent: Friday, February 14, 2025 6:49 AM > > To: Andrew Pinski (QUIC) > > Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org > > Subject

RE: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Andrew Pinski (QUIC)
> -Original Message- > From: Jonathan Wakely > Sent: Friday, February 14, 2025 6:49 AM > To: Andrew Pinski (QUIC) > Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org > Subject: Re: [PATCH] libstc++: Improve list assumption after > constructor [PR118865] > > O

Re: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Jonathan Wakely
On Fri, 14 Feb 2025 at 03:03, Andrew Pinski wrote: > > The code example here does: > ``` > if (begin == end) __builtin_unreachable(); > std::list nl(begin, end); > > for (auto it = nl.begin(); it != nl.end(); it++) > { > ... > } > /* Remove the first element of the list. */ > nl.erase(nl.begin());

[PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-13 Thread Andrew Pinski
The code example here does: ``` if (begin == end) __builtin_unreachable(); std::list nl(begin, end); for (auto it = nl.begin(); it != nl.end(); it++) { ... } /* Remove the first element of the list. */ nl.erase(nl.begin()); ``` And we get a warning because because we jump threaded the case were w