This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Do not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).


Hello

Following patch disables -fgnu-tm with AddressSanitizer.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

gcc/ChangeLog:

2017-07-04  Martin Liska  <mliska@suse.cz>

	PR sanitizer/81302
	* opts.c (finish_options): Do not allow -fgnu-tm
	w/ -fsanitize={kernel-,}address.
---
 gcc/opts.c | 8 ++++++++
 1 file changed, 8 insertions(+)


diff --git a/gcc/opts.c b/gcc/opts.c
index 7460c2be1b6..c8affa4d704 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1004,6 +1004,14 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
 
       opts->x_flag_stack_reuse = SR_NONE;
     }
+
+  if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS) && opts->x_flag_tm)
+    error_at (loc, "transactional memory is not supported with "
+	      "%<-fsanitize=address%>");
+
+  if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_flag_tm)
+    error_at (loc, "transactional memory is not supported with "
+	      "%<-fsanitize=kernel-address%>");
 }
 
 #define LEFT_COLUMN	27


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]