From 577fe16a1aa9f4c7e5634a59830d663c93779c5c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 22 Nov 2018 10:13:19 +0100 Subject: [PATCH] Do not mix -fsanitize=thread and -mabi=ms (PR sanitizer/88017). 2018-11-22 Martin Liska PR sanitizer/88017 * config/i386/i386.c (ix86_option_override_internal): 2018-11-22 Martin Liska PR sanitizer/88017 * gcc.dg/tsan/pr88017.c: New test. From-SVN: r266368 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tsan/pr88017.c | 6 ++++++ 4 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tsan/pr88017.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee5f1835b95..2ae6ce71c10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-22 Martin Liska + + PR sanitizer/88017 + * config/i386/i386.c (ix86_option_override_internal): + 2018-11-21 Uros Bizjak Revert the revert: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 41def54c5c0..edf6dcfb441 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index afd928efb56..1c010484688 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-22 Martin Liska + + PR sanitizer/88017 + * gcc.dg/tsan/pr88017.c: New test. + 2018-11-21 Jakub Jelinek 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 index 00000000000..82693a67e87 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tsan/pr88017.c @@ -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 } */ -- 2.30.2