> Hi Yury, try to use the patch for asan.c to see if it solve your problem.
I tried but unfortunately it did not work for me. Could you try the
patch suggested in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543
(I've attached it) when you have time? This was verified against gcc
testsuite on x64 and ARM.
> My test was to use attached time.cpp for asan test.
BTW I can't reproduce your error on ARM (using gcc trunk):
$
/home/ygribov/install/gcc-master-arm-full/bin/arm-none-linux-gnueabi-gcc
-fsanitize=address -O2 time.cpp
$ qemu-arm -R 0 -L
/home/ygribov/install/gcc-master-arm-full/arm-none-linux-gnueabi/sys-root -E
LD_LIBRARY_PATH=/lib:/usr/lib:/home/ygribov/install/gcc-master-arm-full/arm-none-linux-gnueabi/lib
a.out
-Y
diff --git a/gcc/asan.c b/gcc/asan.c
index 32f1837..acb00ea 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -895,7 +895,7 @@ asan_clear_shadow (rtx shadow_mem, HOST_WIDE_INT len)
gcc_assert ((len & 3) == 0);
top_label = gen_label_rtx ();
- addr = force_reg (Pmode, XEXP (shadow_mem, 0));
+ addr = copy_to_reg (force_reg (Pmode, XEXP (shadow_mem, 0)));
shadow_mem = adjust_automodify_address (shadow_mem, SImode, addr, 0);
end = force_reg (Pmode, plus_constant (Pmode, addr, len));
emit_label (top_label);