[Bug tree-optimization/109434] [12 Regression] std::optional weird -Wmaybe-uninitialized and behaviour with -O2

2023-04-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109434

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||12.2.1
 Resolution|--- |FIXED

--- Comment #8 from Richard Biener  ---
Fixed.

[Bug tree-optimization/109434] [12 Regression] std::optional weird -Wmaybe-uninitialized and behaviour with -O2

2023-04-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
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.

[Bug tree-optimization/109434] [12 Regression] std::optional weird -Wmaybe-uninitialized and behaviour with -O2

2023-04-13 Thread tomas.pecka at cesnet dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109434

--- Comment #6 from Tomáš Pecka  ---
I can confirm that the bug now does not appear in our application code that I
simplified into attached code. Tested on commit df7f55cb2ae.
Thank you!