2018-08-27 Martin Liska <mliska@suse.cz>
PR sanitizer/86962
* sanopt.c (sanitize_rewrite_addressable_params): Ignore
params with DECL_HAS_VALUE_EXPR_P.
2018-08-27 Martin Liska <mliska@suse.cz>
PR sanitizer/86962
* gcc.dg/asan/pr86962.c: New test.
From-SVN: r263882
+2018-08-27 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/86962
+ * sanopt.c (sanitize_rewrite_addressable_params): Ignore
+ params with DECL_HAS_VALUE_EXPR_P.
+
2018-08-27 Martin Liska <mliska@suse.cz>
* config/i386/i386.c (ix86_expand_set_or_movmem): Dump
gimple_add_tmp_var (var);
+ /* We skip parameters that have a DECL_VALUE_EXPR. */
+ if (DECL_HAS_VALUE_EXPR_P (arg))
+ continue;
+
if (dump_file)
fprintf (dump_file,
"Rewriting parameter whose address is taken: %s\n",
IDENTIFIER_POINTER (DECL_NAME (arg)));
- gcc_assert (!DECL_HAS_VALUE_EXPR_P (arg));
-
SET_DECL_PT_UID (var, DECL_PT_UID (arg));
/* Assign value of parameter to newly created variable. */
+2018-08-27 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/86962
+ * gcc.dg/asan/pr86962.c: New test.
+
2018-08-27 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-prof/val-prof-10.c: New test.
--- /dev/null
+/* PR sanitizer/86962 */
+/* { dg-do compile } */
+
+extern int dummy (int *);
+
+void foo(int i)
+{
+ int j=i;
+
+ void bar() { int x=j, y=i; }
+
+ dummy(&i);
+}