+2017-10-19 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/82517
+ * gimplify.c (gimplify_decl_expr): Do not instrument variables
+ that have a large alignment.
+ (gimplify_target_expr): Likewise.
+
2017-10-18 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/82602
&& TREE_ADDRESSABLE (decl)
&& !TREE_STATIC (decl)
&& !DECL_HAS_VALUE_EXPR_P (decl)
+ && DECL_ALIGN (decl) <= MAX_SUPPORTED_STACK_ALIGNMENT
&& dbg_cnt (asan_use_after_scope))
{
asan_poisoned_variables->add (decl);
clobber = build2 (MODIFY_EXPR, TREE_TYPE (temp), temp, clobber);
gimple_push_cleanup (temp, clobber, false, pre_p, true);
}
- if (asan_poisoned_variables && dbg_cnt (asan_use_after_scope))
+ if (asan_poisoned_variables
+ && DECL_ALIGN (temp) <= MAX_SUPPORTED_STACK_ALIGNMENT
+ && dbg_cnt (asan_use_after_scope))
{
tree asan_cleanup = build_asan_poison_call_expr (temp);
if (asan_cleanup)
--- /dev/null
+/* PR sanitizer/82517. */
+
+static int *pp;
+
+void
+baz ()
+{
+ return;
+}
+
+void
+bar (int *p)
+{
+ *p = 1;
+}
+
+void
+foo (int a)
+{
+ if (a == 2)
+ {
+ lab:
+ baz ();
+ return;
+ }
+ if (a > 1)
+ {
+ int x __attribute__ ((aligned (256)));
+ pp = &x;
+ bar (&x);
+ if (!x)
+ goto lab;
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ foo (4);
+ foo (3);
+
+ return 0;
+}