+2014-11-18 Marat Zakirov <m.zakirov@samsung.com>
+
+ * opts.c (finish_options): Disable aggressive opts for sanitizer.
+ (common_handle_option): Move code to finish_options.
+
2014-11-18 Yury Gribov <y.gribov@samsung.com>
PR sanitizer/63802
if (opts->x_flag_sanitize_recover & SANITIZE_LEAK)
error_at (loc, "-fsanitize-recover=leak is not supported");
+
+ /* When instrumenting the pointers, we don't want to remove
+ the null pointer checks. */
+ if (opts->x_flag_sanitize & (SANITIZE_NULL | SANITIZE_NONNULL_ATTRIBUTE
+ | SANITIZE_RETURNS_NONNULL_ATTRIBUTE))
+ opts->x_flag_delete_null_pointer_checks = 0;
+
+ /* Aggressive compiler optimizations may cause false negatives. */
+ if (opts->x_flag_sanitize)
+ {
+ opts->x_flag_aggressive_loop_optimizations = 0;
+ opts->x_flag_strict_overflow = 0;
+ }
}
#define LEFT_COLUMN 27
if (code != OPT_fsanitize_)
break;
- /* When instrumenting the pointers, we don't want to remove
- the null pointer checks. */
- if (opts->x_flag_sanitize & (SANITIZE_NULL | SANITIZE_NONNULL_ATTRIBUTE
- | SANITIZE_RETURNS_NONNULL_ATTRIBUTE))
- opts->x_flag_delete_null_pointer_checks = 0;
-
/* Kernel ASan implies normal ASan but does not yet support
all features. */
if (opts->x_flag_sanitize & SANITIZE_KERNEL_ADDRESS)
--- /dev/null
+/* { dg-options "-fdump-tree-asan" } */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O3" } } */
+
+int ext;
+
+int
+Perl_do_sv_dump()
+{
+ int freq[10];
+ int i;
+ int max = 0;
+
+ if (max < ext)
+ max = ext;
+
+ for (i = 0; i <= max; i++)
+ if (freq[i])
+ ext = 0;
+
+ if (i > 20)
+ return freq[i];
+ else
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "ASAN_CHECK" 2 "asan1" } } */
+/* { dg-final { cleanup-tree-dump "asan1" } } */