Re: Can I provide a hint to gcc for return value optimization?

2021-11-15 Thread Jonathan Wakely via Gcc
On Mon, 15 Nov 2021, 06:47 unlvsur unlvsur via Gcc, wrote: > I want give a hint to gcc that allows std::string to rvo. Is that > possible? Any attribute for doing that? > It's already allowed, and will be done automatically whenever it's possible. >

RE: Can I provide a hint to gcc for return value optimization?

2021-11-15 Thread unlvsur unlvsur via Gcc
Oh I mean copy elision. std::string str; do_something(str); return str; Something like this. Or factory function: std::string foo() { return factory(a.begin(),a.end()); } Sometimes the first one does not guarantee to happen? Sent from Mail for Win

GCC 12.0.0 Status Report (2021-11-15), Stage 3 in effect NOW

2021-11-15 Thread Richard Biener via Gcc
Status == The GCC development branch now is open for general bugfixing (Stage 3). Take the quality data below with a big grain of salt - most of the new P3 classified bugs will become P1 or P2 (generally every regression against GCC 11 is to be considered P1 if it concerns primary or second

Re: GCC 12.0.0 Status Report (2021-11-15), Stage 3 in effect NOW

2021-11-15 Thread H.J. Lu via Gcc
On Mon, Nov 15, 2021 at 4:05 AM Richard Biener via Gcc-patches wrote: > > > Status > == > > The GCC development branch now is open for general bugfixing (Stage 3). > > Take the quality data below with a big grain of salt - most of the > new P3 classified bugs will become P1 or P2 (generally ev

ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Alejandro Colomar (man-pages) via Gcc
Hi all, I'd like to propose the following feature for ISO C (and also ISO C++). It is based on a mix of GCC's [[gnu::nonnull]] and Clang's _Nonnull, with a pinch of salt of mine. I'd like to get some feedback from GCC and Clang, before sending it as an official proposal. BTW, since the working g

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Alejandro Colomar (man-pages) via Gcc
Hi, On 11/15/21 5:01 PM, Alejandro Colomar (man-pages) wrote: > Hi all, > > I'd like to propose the following feature for ISO C (and also ISO C++). > It is based on a mix of GCC's [[gnu::nonnull]] and Clang's _Nonnull, > with a pinch of salt of mine. > > I'd like to get some feedback from GCC an

Re: Anything I can contribute?

2021-11-15 Thread Philip Herron
Hi Kaisheng, There are plenty of places to get started on the Rust Front-end for GCC if you are interested? - https://github.com/Rust-GCC/gccrs - https://github.com/Rust-GCC/gccrs/blob/master/CONTRIBUTING.md - https://github.com/Rust-GCC/gccrs/issues?q=is%3Aissue+is%3Aopen+label%3Agood-first-pr

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Joseph Myers
lvalue-to-rvalue conversion loses qualifiers, which makes any rules based on whether the RHS of an assignment was nonnull-qualified very problematic. (The specification of restrict is exceedingly tricky and very unlikely to be a good basis for specifying any other feature.) I don't think a man

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Alejandro Colomar (man-pages) via Gcc
Hi Joseph, On 11/15/21 21:18, Joseph Myers wrote: lvalue-to-rvalue conversion loses qualifiers, which makes any rules based on whether the RHS of an assignment was nonnull-qualified very problematic. (The specification of restrict is exceedingly tricky and very unlikely to be a good basis for s

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Joseph Myers
On Mon, 15 Nov 2021, Alejandro Colomar (man-pages) via Gcc wrote: > How is restrict handling that problem of lvalue-to-rvalue already? restrict has tricky rules about "based on" (6.7.3.1). -- Joseph S. Myers jos...@codesourcery.com

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Alejandro Colomar (man-pages) via Gcc
Hi Joseph, On 11/15/21 23:17, Joseph Myers wrote: On Mon, 15 Nov 2021, Alejandro Colomar (man-pages) via Gcc wrote: How is restrict handling that problem of lvalue-to-rvalue already? restrict has tricky rules about "based on" (6.7.3.1). Hmm, I think I can "base on" that, to define what I h

Re: ISO C3X proposal: nonnull qualifier

2021-11-15 Thread Joseph Myers
On Mon, 15 Nov 2021, Alejandro Colomar (man-pages) via Gcc wrote: > Hi Joseph, > > On 11/15/21 23:17, Joseph Myers wrote: > > On Mon, 15 Nov 2021, Alejandro Colomar (man-pages) via Gcc wrote: > > > > > How is restrict handling that problem of lvalue-to-rvalue already? > > > > restrict has trick

Re: Can I provide a hint to gcc for return value optimization?

2021-11-15 Thread Jason Merrill via Gcc
On Mon, Nov 15, 2021 at 3:17 AM unlvsur unlvsur via Gcc wrote: > Oh I mean copy elision. > > std::string str; > do_something(str); > return str; > > Something like this. > > Or factory function: > std::string foo() > { > return factory(a.begin(),a.end()); > } > Neither return should involve a co

Re: Anything I can contribute?

2021-11-15 Thread Deng Kaisheng
Thanks! > 在 2021年11月16日,上午1:17,Philip Herron 写道: > > - External Email - > > > > Hi Kaisheng, > > There are plenty of places to get started on the Rust Front-end for > GCC if you are interested? > > - https://github.com/Rust-GCC/gccrs > - https://github.com/Rust-GCC/gccrs/blob/mast