Re: C++ undefined behaviour sanitiser bug when compiled with optimization

2023-09-01 Thread Jonathan Wakely via Gcc-bugs
This mailing list is for automated email from our bug tracker, it's not for reporting bugs directly. Emails sent to this list are likely to be missed, and definitely won't get entered into the bug tracker. Please use Bugzilla to report bugs, as described at https://gcc.gnu.org/bugs/

C++ undefined behaviour sanitiser bug when compiled with optimization

2023-09-01 Thread Hannes Mühleisen
Hello, we ran into an issue with the following (rather benign) C++ snippet: #include #include struct Foo { void Bar() ; std::mutex some_lock; std::atomic some_number; }; void Foo::Bar() { some_lock.lock(); some_number++; some_lock.unlock(); } When compiling