On Mon, 2016-11-07 at 11:03 +0100, Martin Liška wrote: > Hello. > > After discussion with Jakub, I'm resending new version of the patch, > where I changed following: > 1) gimplify_ctxp->live_switch_vars is used to track variables > introduced in switch_expr. Every time > a case_label_expr is seen, these are unpoisoned. It's quite > conservative, however it covers all > corner cases on can come up with. Compared to clang, we are much > more precise in switch statements > where a variable liveness crosses label boundary. > 2) I found a bug where ASAN_CHECK was optimized out due to missing > check of IFN_ASAN_MARK internal fn. > Test was added for that. > 3) Multiple switch tests have been added, which is going to be sent > in upcoming email. > > Patch can bootstrap on ppc64le-redhat-linux and survives regression > tests (+ asan bootstrap finishes > successfully). The patch (r241896) introduced an error in the build of the jit: ../../src/gcc/jit/jit-builtins.c:62:1: error: invalid conversion from ‘int’ to ‘gcc::jit::built_in_attribute’ [-fpermissive] }; ^ which seems to be due to the "0" for ATTRS in: --- a/gcc/sanitizer.def +++ b/gcc/sanitizer.def @@ -165,6 +165,10 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT, DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT, "__asan_after_dynamic_init", BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST) +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_CLOBBER_N, "__asan_poison_stack_memory", + BT_FN_VOID_PTR_PTRMODE, 0) +DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNCLOBBER_N, "__asan_unpoison_stack_memory", + BT_FN_VOID_PTR_PTRMODE, 0) Is the attached patch OK as a fix? (assuming testing passes) Or should these builtins have other attrs? (sorry, am not very familiar with the sanitizer code). Dave