diff --git a/gcc/opts.cc b/gcc/opts.cc index fe0293e4283..54e57f36755 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -1214,7 +1214,9 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, /* Address sanitizers conflict with the thread sanitizer. */ report_conflicting_sanitizer_options (opts, loc, SANITIZE_THREAD, - SANITIZE_ADDRESS | SANITIZE_HWADDRESS); + SANITIZE_ADDRESS); + report_conflicting_sanitizer_options (opts, loc, SANITIZE_THREAD, + SANITIZE_HWADDRESS); /* The leak sanitizer conflicts with the thread sanitizer. */ report_conflicting_sanitizer_options (opts, loc, SANITIZE_LEAK, SANITIZE_THREAD); diff --git a/gcc/testsuite/c-c++-common/hwasan/arguments-3.c b/gcc/testsuite/c-c++-common/hwasan/arguments-3.c index 6e907b46b3b..2bf8917355b 100644 --- a/gcc/testsuite/c-c++-common/hwasan/arguments-3.c +++ b/gcc/testsuite/c-c++-common/hwasan/arguments-3.c @@ -1,3 +1,5 @@ /* { dg-do compile } */ -/* { dg-additional-options "-fsanitize=thread" } */ +/* { dg-additional-options "-fsanitize=thread,address" } */ +/* { dg-error ".*'-fsanitize=thread' is incompatible with '-fsanitize=address'.*" "" { target *-*-* } 0 } */ /* { dg-error ".*'-fsanitize=thread' is incompatible with '-fsanitize=hwaddress'.*" "" { target *-*-* } 0 } */ +/* { dg-error ".*'-fsanitize=hwaddress' is incompatible with '-fsanitize=address'.*" "" { target *-*-* } 0 } */