Do not mix -fsanitize=thread and -mabi=ms (PR sanitizer/88017).
authorMartin Liska <mliska@suse.cz>
Thu, 22 Nov 2018 09:13:19 +0000 (10:13 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 22 Nov 2018 09:13:19 +0000 (09:13 +0000)
2018-11-22  Martin Liska  <mliska@suse.cz>

PR sanitizer/88017
* config/i386/i386.c (ix86_option_override_internal):
2018-11-22  Martin Liska  <mliska@suse.cz>

PR sanitizer/88017
* gcc.dg/tsan/pr88017.c: New test.

From-SVN: r266368

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tsan/pr88017.c [new file with mode: 0644]

index ee5f1835b9522569b2b927995c376a697ad31e9c..2ae6ce71c1089890dd7d7610d9a2888eac6f09f2 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-22  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/88017
+       * config/i386/i386.c (ix86_option_override_internal):
+
 2018-11-21  Uros Bizjak  <ubizjak@gmail.com>
 
        Revert the revert:
index 41def54c5c035b20434887ad3db503e84edbf037..edf6dcfb4412591251f87be67e4777ad8376db19 100644 (file)
@@ -3550,6 +3550,8 @@ ix86_option_override_internal (bool main_args_p,
     error ("%<-mabi=ms%> not supported with %<-fsanitize=address%>");
   if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_ix86_abi == MS_ABI)
     error ("%<-mabi=ms%> not supported with %<-fsanitize=kernel-address%>");
+  if ((opts->x_flag_sanitize & SANITIZE_THREAD) && opts->x_ix86_abi == MS_ABI)
+    error ("%<-mabi=ms%> not supported with %<-fsanitize=thread%>");
 
   /* For targets using ms ABI enable ms-extensions, if not
      explicit turned off.  For non-ms ABI we turn off this
index afd928efb566f7408a783780a3a436484b64d69f..1c010484688928e2ee06e8760d300ecaa82cf36c 100644 (file)
@@ -1,3 +1,8 @@
+2018-11-22  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/88017
+       * gcc.dg/tsan/pr88017.c: New test.
+
 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/88122
diff --git a/gcc/testsuite/gcc.dg/tsan/pr88017.c b/gcc/testsuite/gcc.dg/tsan/pr88017.c
new file mode 100644 (file)
index 0000000..82693a6
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-fsanitize=thread -mabi=ms" } */
+
+int i;
+
+/* { dg-error ".-mabi=ms. not supported with .-fsanitize=thread." "" { target *-*-* } 0 } */