+2016-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/78832
+ * sanopt.c (sanitize_asan_mark_unpoison): Remove next variable, use
+ continue if gsi_next should be skipped.
+ (sanitize_asan_mark_poison): Remove prev variable, use continue if
+ gsi_prev should be skipped. When removing ASAN_MARK, do gsi_prev
+ first and gsi_remove on a previously made copy of the iterator.
+
2016-12-17 Andrew Senkevich <andrew.senkevich@intel.com>
* config/i386/avx512bwintrin.h: Add new k-mask intrinsics.
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
- bool next = true;
gimple *stmt = gsi_stmt (gsi);
if (gimple_call_internal_p (stmt, IFN_ASAN_MARK))
{
unlink_stmt_vdef (stmt);
release_defs (stmt);
gsi_remove (&gsi, true);
- next = false;
+ continue;
}
}
- if (next)
- gsi_next (&gsi);
+ gsi_next (&gsi);
}
}
}
gimple_stmt_iterator gsi;
for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi);)
{
- bool prev = true;
gimple *stmt = gsi_stmt (gsi);
if (maybe_contains_asan_check (stmt))
break;
fprintf (dump_file, "Removing ASAN_MARK poison\n");
unlink_stmt_vdef (stmt);
release_defs (stmt);
- gsi_remove (&gsi, true);
- prev = false;
+ gimple_stmt_iterator gsi2 = gsi;
+ gsi_prev (&gsi);
+ gsi_remove (&gsi2, true);
+ continue;
}
- if (prev)
- gsi_prev (&gsi);
+ gsi_prev (&gsi);
}
}
}
+2016-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/78832
+ * gcc.dg/asan/pr78832.c: New test.
+
2016-12-17 Andrew Senkevich <andrew.senkevich@intel.com>
* gcc.target/i386/avx512bw-kaddd-1.c: New test.
--- /dev/null
+/* PR sanitizer/78832 */
+/* { dg-do compile } */
+/* { dg-additional-options "-fcompare-debug" } */
+
+void bar (int *);
+
+int
+foo (int x)
+{
+ int *f = 0;
+ if (x)
+ goto lab;
+ {
+ int y, z;
+ bar (&y);
+ int *d = &y;
+ bar (&z);
+ int *e = &z;
+ }
+ f = &x;
+ lab: return 6;
+}