This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Do not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 10 Jul 2017 11:35:28 +0200
- Subject: [PATCH] Do not allow -fgnu-tm w/ -fsanitize={kernel-,}address (PR sanitizer/81302).
- Authentication-results: sourceware.org; auth=none
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