]> gcc.gnu.org Git - gcc.git/commitdiff
sanitizer: Fix hwasan related option conflicts [PR106132]
authorMartin Liska <mliska@suse.cz>
Wed, 29 Jun 2022 08:26:52 +0000 (10:26 +0200)
committerMartin Liska <mliska@suse.cz>
Fri, 8 Jul 2022 11:23:44 +0000 (13:23 +0200)
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
gcc/testsuite/c-c++-common/hwasan/arguments-3.c

index fe0293e4283df41248dfdfb572c60b9ae9b6e437..54e57f367559c078bddc782d793ba2f424787da6 100644 (file)
@@ -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);
index 6e907b46b3bb98066746f4619ff8b47e145c4911..2bf8917355bef35c0c8612fcb386c992c14d16e4 100644 (file)
@@ -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 } */
This page took 0.076066 seconds and 5 git commands to generate.