On Wed, Oct 15, 2014 at 8:59 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Tue, Oct 14, 2014 at 08:39:40PM +0400, Ilya Palachev wrote: >> Attached patch fixes PR lto/61048 - >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61048 > > Given that the patch just replaces an ICE with a necessary link failure, I'd > say > it is done at the wrong place, instead during the LTO option handling you > should error out if there are incompatibilities in -fsanitize options > (any object compiled with flag_sanitize & SANITIZE_USER_ADDRESS, but > link done without that, ditto for SANITIZE_KERNEL_ADDRESS, SANITIZE_THREAD. > And finally if flag_sanitize & (SANITIZE_UNDEFINED | SANITIZE_NONDEFALT) > is non-zero but during linking it is zero (it doesn't really matter which > exact undefined sanitization options are used at what time).
Yep. As with other options this looks like it needs "conservative" merging. Which might be more involved than for other cases - but well... Look at existing examples in gcc/lto-opts.c and gcc/lto-wrapper.c. Richard. > BTW, in your patches please watch formatting, you didn't use space before (. > > Jakub