public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/112981] New: [13/14 Regression] Big compile time and run time regression in libasan with g:f732bf6a603721f61102a08ad2d023c7c2670870
@ 2023-12-12 10:08 tnfchris at gcc dot gnu.org
  2023-12-12 10:13 ` [Bug sanitizer/112981] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2023-12-12 10:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112981

            Bug ID: 112981
           Summary: [13/14 Regression] Big compile time and run time
                    regression in libasan with
                    g:f732bf6a603721f61102a08ad2d023c7c2670870
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compile-time-hog
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-*

Starting with the sync with upstream in
g:f732bf6a603721f61102a08ad2d023c7c2670870

f732bf6a603721f61102a08ad2d023c7c2670870 is the first bad commit
commit f732bf6a603721f61102a08ad2d023c7c2670870
Author: Martin Liska <mliska@suse.cz>
Date:   Tue May 3 12:56:26 2022 +0200

    libsanitizer: merge from upstream
(0a1bcab9f3bf75c4c5d3e53bafb3eeb80320af46).

there's a massive compile time and performance overhead (6x slower) when using
-fsanitize=address.

The following testcase (due to the dependencies provided as cmake project)
illustrates this:

-- main.cpp:

#include <catch2/generators/catch_generators.hpp>
#include <catch2/catch_test_macros.hpp>

TEST_CASE("Test") {
  for (int i= 0; i<1000000; i++) {
    REQUIRE(1 + 2 == 3);
  }
}

-- CMakeList.txt

cmake_minimum_required(VERSION 3.5)
project(slow_asan)

add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)

Include(FetchContent)
FetchContent_Declare(
    Catch2
    SYSTEM
    GIT_REPOSITORY https://github.com/catchorg/Catch2.git
    GIT_TAG v3.3.0
)

FetchContent_MakeAvailable(Catch2)

add_executable(tests main.cpp)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)

--- command

cmake -DCMAKE_C_COMPILER=${install_dir}/bin/gcc
-DCMAKE_CXX_COMPILER=${install_dir}/bin/g++ -DCMAKE_BUILD_TYPE=Release . &&
make VERBOSE=1 -j && timeout 10.0s ./tests

will take significantly longer than in GCC 12 (compiles at -O3).

I have not yet tracked down if the compile hog is a GCC issue or not.

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

end of thread, other threads:[~2023-12-12 23:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 10:08 [Bug sanitizer/112981] New: [13/14 Regression] Big compile time and run time regression in libasan with g:f732bf6a603721f61102a08ad2d023c7c2670870 tnfchris at gcc dot gnu.org
2023-12-12 10:13 ` [Bug sanitizer/112981] " pinskia at gcc dot gnu.org
2023-12-12 10:15 ` pinskia at gcc dot gnu.org
2023-12-12 10:44 ` rguenth at gcc dot gnu.org
2023-12-12 23:12 ` pinskia at gcc dot gnu.org
2023-12-12 23:13 ` pinskia 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).