[Bug tree-optimization/108565] -Wuse-after-free false positive triggered by -O2 on a shared_ptr implementation

2023-01-28 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565 --- Comment #5 from Jan Hubicka --- Teaching modref that THIS parameter of all destructors is nonescape looks like interesting idea (and easy to implement). Memory stores are currently indeed handled as "anyting may happen". modref does

[Bug tree-optimization/108565] -Wuse-after-free false positive triggered by -O2 on a shared_ptr implementation

2023-01-27 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565 --- Comment #4 from Jonathan Wakely --- (In reply to Richard Biener from comment #3) > I suspect 'operator new' is not returns_nonnull for the variant that isn't > noexcept. That would be my first stab at improving things. Not sure > what the

[Bug tree-optimization/108565] -Wuse-after-free false positive triggered by -O2 on a shared_ptr implementation

2023-01-27 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565 Richard Biener changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug tree-optimization/108565] -Wuse-after-free false positive triggered by -O2 on a shared_ptr implementation

2023-01-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565 Andrew Pinski changed: What|Removed |Added Keywords||EH --- Comment #2 from Andrew Pinski

[Bug tree-optimization/108565] -Wuse-after-free false positive triggered by -O2 on a shared_ptr implementation

2023-01-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108565 --- Comment #1 from Andrew Pinski --- The missed optimization is because we don't optimize: MEM[(int *)_28] = 2; _8 = operator new (4); [local count: 1073741825]: MEM[(int *)_8] = 20; MEM[(int *)_8] ={v} {CLOBBER}; operator