On 6/28/23 04:21, Richard Biener via Gcc-patches wrote:
When NRV replaces a local variable with <retval> it also replaces occurences in clobbers. This leads to <retval> being clobbered before the return of it which is strictly invalid but harmless in practice since there's no pass after NRV which would remove earlier stores. The following fixes this nevertheless. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? Thanks, Richard. PR tree-optimization/110434 * tree-nrv.cc (pass_nrv::execute): Remove CLOBBERs of VAR we replace with <retval>.
OK. jeff