On Mon, Nov 12, 2018 at 01:03:41PM +0100, Martin Liška wrote: > The patch reject usage of the mentioned options. > > Ready for trunk? > Thanks, > Martin > > gcc/ChangeLog: > > 2018-11-12 Martin Liska <mli...@suse.cz> > > PR sanitizer/87930 > * config/i386/i386.c (ix86_option_override_internal): Error > about usage -mabi=ms and -fsanitize={,kernel-}address.
Please add testcases for this. Can this be changed through attribute too? If so, a test for that should be there too. > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -3546,6 +3546,11 @@ 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%>"); > + > /* For targets using ms ABI enable ms-extensions, if not > explicit turned off. For non-ms ABI we turn off this > option. */ > Jakub