tree-optimization/110434 - avoid <retval> ={v} {CLOBBER} from NRV
commit4bf76b5b6db8e68755788ec91012c5a686440720
authorRichard Biener <rguenther@suse.de>
Wed, 28 Jun 2023 09:27:45 +0000 (28 11:27 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 28 Jun 2023 13:52:16 +0000 (28 15:52 +0200)
tree623444b0bf98311c63d488beea66f18acc570e81
parentc7e87e82435b918084f305386b12b8fbcdcf3307
tree-optimization/110434 - avoid <retval> ={v} {CLOBBER} from NRV

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.

PR tree-optimization/110434
* tree-nrv.cc (pass_nrv::execute): Remove CLOBBERs of
VAR we replace with <retval>.
gcc/tree-nrv.cc