public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110835] New: -fsanitize=address causes slowdown from std::rethrow_exception not called
@ 2023-07-28  4:53 ed at catmur dot uk
  2023-07-28  4:55 ` [Bug c++/110835] " ed at catmur dot uk
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ed at catmur dot uk @ 2023-07-28  4:53 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-05-21  9:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  4:53 [Bug c++/110835] New: -fsanitize=address causes slowdown from std::rethrow_exception not called ed at catmur dot uk
2023-07-28  4:55 ` [Bug c++/110835] " ed at catmur dot uk
2023-07-28  5:06 ` [Bug sanitizer/110835] " pinskia at gcc dot gnu.org
2023-07-28  5:10 ` pinskia at gcc dot gnu.org
2023-07-28  5:10 ` [Bug sanitizer/110835] [13/14 Regression] -fsanitize=address causes huge runtime " pinskia at gcc dot gnu.org
2023-07-28  5:12 ` pinskia at gcc dot gnu.org
2023-07-28  8:01 ` ed at catmur dot uk
2023-12-12 23:12 ` pinskia at gcc dot gnu.org
2024-03-07 23:27 ` law at gcc dot gnu.org
2024-05-21  9:16 ` [Bug sanitizer/110835] [13/14/15 " jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).