Commit 080629d3 by Martin Liska Committed by Martin Liska

Error only when a non-default -mabi is used with sanitizers (PR sanitizer/90312).

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
parent ee7a003f
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> 2019-05-06 Hrishikesh Kulkarni <hrishikeshparag@gmail.com>
Martin Liska <mliska@suse.cz> Martin Liska <mliska@suse.cz>
......
...@@ -1704,12 +1704,17 @@ ix86_option_override_internal (bool main_args_p, ...@@ -1704,12 +1704,17 @@ ix86_option_override_internal (bool main_args_p,
error ("%<-mabi=ms%> not supported with X32 ABI"); error ("%<-mabi=ms%> not supported with X32 ABI");
gcc_assert (opts->x_ix86_abi == SYSV_ABI || opts->x_ix86_abi == MS_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) const char *abi_name = opts->x_ix86_abi == MS_ABI ? "ms" : "sysv";
error ("%<-mabi=ms%> not supported with %<-fsanitize=address%>"); if ((opts->x_flag_sanitize & SANITIZE_USER_ADDRESS)
if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS) && opts->x_ix86_abi == MS_ABI) && opts->x_ix86_abi != DEFAULT_ABI)
error ("%<-mabi=ms%> not supported with %<-fsanitize=kernel-address%>"); error ("%<-mabi=%s%> not supported with %<-fsanitize=address%>", abi_name);
if ((opts->x_flag_sanitize & SANITIZE_THREAD) && opts->x_ix86_abi == MS_ABI) if ((opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS)
error ("%<-mabi=ms%> not supported with %<-fsanitize=thread%>"); && 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 /* For targets using ms ABI enable ms-extensions, if not
explicit turned off. For non-ms ABI we turn off this explicit turned off. For non-ms ABI we turn off this
......
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> 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 * gcc.dg/tree-ssa/pr37508.c: Add the no-ssa-phiopt option to skip phi
......
/* { 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" } */ /* { dg-options "-fsanitize=address -mabi=ms" } */
int i; int i;
......
/* { 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" } */ /* { dg-options "-fsanitize=thread -mabi=ms" } */
int i; int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment