[Bug c++/110835] New: -fsanitize=address causes slowdown from std::rethrow_exception not called
ed at catmur dot uk
gcc-bugzilla@gcc.gnu.org
Fri Jul 28 04:53:15 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110835
Bug ID: 110835
Summary: -fsanitize=address causes slowdown from
std::rethrow_exception not called
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include <exception>
std::exception_ptr p;
void f() {
try { throw 1; } catch(char) { std::rethrow_exception(p); }
}
int main() {
for (int i = 0; i != 100000; ++i)
try { f(); } catch (...) { }
}
Compiled with -fsanitize=address (and at -O0 through -O3), this is roughly 30x
slower under gcc 13 than under gcc 12 (4.7s vs 0.15s on my Core i7 3 GHz).
Note that the std::rethrow_exception() is not called, but is still essential to
exhibit the bug. Also `f` needs to be a separate function (and not `static`).
At low optimization levels it can be an iife.
More information about the Gcc-bugs
mailing list