Re: [PATCH RFA] gimplify: prevent some C++ temporary elision

2022-10-06 Thread Richard Biener via Gcc-patches
On Thu, Oct 6, 2022 at 8:23 PM Jason Merrill via Gcc-patches wrote: > > Tested x86_64-pc-linux-gnu, OK for trunk? OK. Thanks, Richard. > -- >8 -- > > In this testcase, we were optimizing away the temporary for f(), but > C++17 and above are clear that there is a temporary, and because its > des

[PATCH RFA] gimplify: prevent some C++ temporary elision

2022-10-06 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, OK for trunk? -- >8 -- In this testcase, we were optimizing away the temporary for f(), but C++17 and above are clear that there is a temporary, and because its destructor has visible side-effects we can't optimize it away under the as-if rule. So disable this optimiz