]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Error only when a non-default -mabi is used with sanitizers (PR sanitizer/90312).
authorMartin Liska <mliska@suse.cz>
Mon, 6 May 2019 07:35:59 +0000 (09:35 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 6 May 2019 07:35:59 +0000 (07:35 +0000)
2019-05-06  Martin Liska  <mliska@suse.cz>

PR sanitizer/90312
* config/i386/i386-options.c (ix86_option_override_internal): Error only
when -mabi is selected to a non-default version.
2019-05-06  Martin Liska  <mliska@suse.cz>

PR sanitizer/90312
* gcc.dg/asan/pr87930.c: Run the test only on *linux or *gnu
systems.
* gcc.dg/tsan/pr88017.c: Likewise.

From-SVN: r270899

gcc/ChangeLog
gcc/config/i386/i386-options.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/asan/pr87930.c
gcc/testsuite/gcc.dg/tsan/pr88017.c

index 06ba752591d1bc7e4a1aa29ffb0d070fd21dc4e6..9db79406e07ad13e7c9fe45040bcdc7165961166 100644 (file)
@@ -1,3 +1,9 @@
+2019-05-06  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/90312
+       * config/i386/i386-options.c (ix86_option_override_internal): Error only
+       when -mabi is selected to a non-default version.
+
 2019-05-06  Hrishikesh Kulkarni  <hrishikeshparag@gmail.com>
            Martin Liska  <mliska@suse.cz>
 
index 1a673d278eeac2ac151eaaff5eca32add607883c..4ec10efacfabb5eca1455bf6f422b250a41b2259 100644 (file)
@@ -1704,12 +1704,17 @@ ix86_option_override_internal (bool main_args_p,
     error ("%<-mabi=ms%> not supported with X32 ABI");
   gcc_assert (opts->x_ix86_abi == SYSV_ABI || opts->x_ix86_abi == MS_ABI);
 
-  if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) && opts->x_ix86_abi == MS_ABI)
-    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%>");
+  const char *abi_name = opts->x_ix86_abi == MS_ABI ? "ms" : "sysv";
+  if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS)
+      && opts->x_ix86_abi != DEFAULT_ABI)
+    error ("%<-mabi=%s%> not supported with %<-fsanitize=address%>", abi_name);
+  if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS)
+      && opts->x_ix86_abi != DEFAULT_ABI)
+    error ("%<-mabi=%s%> not supported with %<-fsanitize=kernel-address%>",
+          abi_name);
+  if ((opts->x_flag_sanitize & SANITIZE_THREAD)
+      && opts->x_ix86_abi != DEFAULT_ABI)
+    error ("%<-mabi=%s%> not supported with %<-fsanitize=thread%>", abi_name);
 
   /* For targets using ms ABI enable ms-extensions, if not
      explicit turned off.  For non-ms ABI we turn off this
index bf4a602d73d06c17a691c3032cc58aa372527658..3e4bf2b56ee65a39a1254448995856f69982dcfb 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-06  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/90312
+       * gcc.dg/asan/pr87930.c: Run the test only on *linux or *gnu
+       systems.
+       * gcc.dg/tsan/pr88017.c: Likewise.
+
 2019-05-06  Li Jia He  <helijia@linux.ibm.com>
 
        * gcc.dg/tree-ssa/pr37508.c: Add the no-ssa-phiopt option to skip phi
index 4f8e6999fde855381580edeace5df21178afd393..5a65d3fb03097943c659b062bd5db59ad02f601d 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && lp64 } } } */
 /* { dg-options "-fsanitize=address -mabi=ms" } */
 
 int i;
index 82693a67e8722c04d19c0cc1b49af2bfa8934904..10df2818b0d35a10d597868f9ce97ef6ed136869 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-do compile { target { { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } && lp64 } } } */
 /* { dg-options "-fsanitize=thread -mabi=ms" } */
 
 int i;