* [PATCH] sanitizer: Fix hwasan related option conflicts [PR106132]
@ 2022-06-29 12:04 Martin Liška
2022-07-01 19:34 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2022-06-29 12:04 UTC (permalink / raw)
To: gcc-patches
Split report_conflicting_sanitizer_options(..., SANITIZE_ADDRESS | SANITIZE_HWADDRESS)
call into 2 calls as we don't have any option that would be
address+hwaddress (that conflicts as well).
PR sanitizer/106132
gcc/ChangeLog:
* opts.cc (finish_options): Use 2 calls to
report_conflicting_sanitizer_options.
gcc/testsuite/ChangeLog:
* c-c++-common/hwasan/arguments-3.c: Cover new ICE.
---
gcc/opts.cc | 4 +++-
gcc/testsuite/c-c++-common/hwasan/arguments-3.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
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 } */
--
2.36.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sanitizer: Fix hwasan related option conflicts [PR106132]
2022-06-29 12:04 [PATCH] sanitizer: Fix hwasan related option conflicts [PR106132] Martin Liška
@ 2022-07-01 19:34 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2022-07-01 19:34 UTC (permalink / raw)
To: gcc-patches
On 6/29/2022 6:04 AM, Martin Liška wrote:
> Split report_conflicting_sanitizer_options(..., SANITIZE_ADDRESS |
> SANITIZE_HWADDRESS)
> call into 2 calls as we don't have any option that would be
> address+hwaddress (that conflicts as well).
>
> PR sanitizer/106132
>
> gcc/ChangeLog:
>
> * opts.cc (finish_options): Use 2 calls to
> report_conflicting_sanitizer_options.
>
> gcc/testsuite/ChangeLog:
>
> * c-c++-common/hwasan/arguments-3.c: Cover new ICE.
OK
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-01 19:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 12:04 [PATCH] sanitizer: Fix hwasan related option conflicts [PR106132] Martin Liška
2022-07-01 19:34 ` Jeff Law
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).