[gcc/devel/omp/gcc-9] Backport r270899

Tobias Burnus burnus@gcc.gnu.org
Thu Mar 5 13:44:00 GMT 2020


https://gcc.gnu.org/g:6df94d59ac43d424fde8b722baed9500e1c34f1f

commit 6df94d59ac43d424fde8b722baed9500e1c34f1f
Author: Martin Liska <mliska@suse.cz>
Date:   Mon May 6 16:01:45 2019 +0200

    Backport r270899
    
    2019-05-06  Martin Liska  <mliska@suse.cz>
    
    	Backport from mainline
    	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>
    
    	Backport from mainline
    	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: r270912

Diff:
---
 gcc/ChangeLog                       |  9 +++++++++
 gcc/config/i386/i386.c              | 17 +++++++++++------
 gcc/testsuite/ChangeLog             | 10 ++++++++++
 gcc/testsuite/gcc.dg/asan/pr87930.c |  2 +-
 gcc/testsuite/gcc.dg/tsan/pr88017.c |  2 +-
 5 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ddfb3b6..b1659d3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2019-05-06  Martin Liska  <mliska@suse.cz>
+
+	Backport from mainline
+	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-04  Michael Meissner  <meissner@linux.ibm.com>
 
 	* ChangeLog.ibm: Delete unintentional commit on the wrong branch.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8a1ffd3..5b946e1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3705,12 +3705,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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cb4df8a..08fc24e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2019-05-06  Martin Liska  <mliska@suse.cz>
+
+	Backport from mainline
+	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-04  Michael Meissner  <meissner@linux.ibm.com>
 
 	* ChangeLog.ibm: Delete unintentional commit on the wrong branch.
diff --git a/gcc/testsuite/gcc.dg/asan/pr87930.c b/gcc/testsuite/gcc.dg/asan/pr87930.c
index 4f8e699..5a65d3f 100644
--- a/gcc/testsuite/gcc.dg/asan/pr87930.c
+++ b/gcc/testsuite/gcc.dg/asan/pr87930.c
@@ -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;
diff --git a/gcc/testsuite/gcc.dg/tsan/pr88017.c b/gcc/testsuite/gcc.dg/tsan/pr88017.c
index 82693a6..10df2818 100644
--- a/gcc/testsuite/gcc.dg/tsan/pr88017.c
+++ b/gcc/testsuite/gcc.dg/tsan/pr88017.c
@@ -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;



More information about the Gcc-cvs mailing list