https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109434
--- Comment #7 from CVS Commits ---
The releases/gcc-12 branch has been updated by Richard Biener
:
https://gcc.gnu.org/g:3d2210dafd872e8470e2a6ae5eea74d2669bc055
commit r12-9415-g3d2210dafd872e8470e2a6ae5eea74d2669bc055
Author: Richard Biener
Date: Tue Apr 11 15:06:59 2023 +0200
tree-optimization/109434 - bogus DSE of throwing call LHS
The byte tracking of call LHS didn't properly handle possibly
throwing calls correctly which cases bogus DSE and in turn, for the
testcase a bogus uninit diagnostic and (unreliable) wrong-code.
PR tree-optimization/109434
* tree-ssa-dse.cc (initialize_ao_ref_for_dse): Properly
handle possibly throwing calls when processing the LHS
and may-defs are not OK. Add mode to initialize a may-def.
(dse_optimize_stmt): Query may-defs.
* g++.dg/opt/pr109434.C: New testcase.