On 01/26/2016 02:24 PM, Jakub Jelinek wrote:
just designed to enable DEF_SANITIZER_BUILTIN (IIUC). Also, why use shift
and not just sanitize=undefined?
Because -fsanitize=undefined is a large collection of individual sanitizers,
and at least some of them affect also post-IPA code (e.g.
-fsanitize=unreachable). The goal is to pick one of the sanitizers that are
handled solely pre-IPA only, after that just are present in form of a
builtin call in the IL (and thus all that lto1 needs to do for that option
is initialize the builtins).
Ok. That should also go into one of the comments describing the choice
of -fsanitize=shift.
Maybe. It also has to check the option->value though. The thing is,
because I didn't want to memmove options around when processing the first
TU, it will canonicalize all the -f{,no-}sanitize= options depending on if
in the end some ubsan sanitizers were enabled or not to
-f{,no-}sanitize=shift. And merge_and_complain thus should ignore
all the -fno-sanitize=shift options in DECODED_OPTIONS, if it finds any
-fsanitize=shift in DECODED_OPTIONS (optionally preceeded by some
-fno-sanitize=shift), then nothing needs to be added, otherwise
-fsanitize=shift is added.
Again that sort of thing might be worthwhile to have in a comment.
Bernd