re PR sanitizer/80444 (-fcompare-debug failures with -fsanitize-coverage=trace-pc)
authorJakub Jelinek <jakub@redhat.com>
Tue, 18 Apr 2017 15:02:06 +0000 (17:02 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 18 Apr 2017 15:02:06 +0000 (17:02 +0200)
PR sanitizer/80444
* sancov.c (sancov_pass): Use gsi_start_nondebug_after_labels_bb
instead of gsi_after_labels.

* gcc.dg/sancov/pr80444.c: New test.

From-SVN: r246971

gcc/ChangeLog
gcc/sancov.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/sancov/pr80444.c [new file with mode: 0644]

index 8da35cc67e3d3533f0302ebe987a664a784f0bd7..07b3384677feb5522b72d6997208a7d5af2e339a 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/80444
+       * sancov.c (sancov_pass): Use gsi_start_nondebug_after_labels_bb
+       instead of gsi_after_labels.
+
 2017-04-18  Jeff Law  <law@redhat.com>
 
        * regcprop.c (maybe_mode_change): Avoid creating copies of the
index b4d5cc58e7e068cb4e8e2ef2029979b6d67749df..1651989ea2429ec372149835bb4636a8048051ce 100644 (file)
@@ -46,7 +46,7 @@ sancov_pass (function *fun)
   basic_block bb;
   FOR_EACH_BB_FN (bb, fun)
     {
-      gimple_stmt_iterator gsi = gsi_after_labels (bb);
+      gimple_stmt_iterator gsi = gsi_start_nondebug_after_labels_bb (bb);
       if (gsi_end_p (gsi))
        continue;
       gimple *stmt = gsi_stmt (gsi);
index 728f2cfb600161ba8b60021a7ecc7e23013ac572..4d1cd159d155505a270f8cb065305dcea9482f54 100644 (file)
@@ -1,5 +1,8 @@
 2017-04-18  Jakub Jelinek  <jakub@redhat.com>
 
+       PR sanitizer/80444
+       * gcc.dg/sancov/pr80444.c: New test.
+
        PR middle-end/79788
        PR middle-end/80375
        * gcc.dg/pr79788-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/sancov/pr80444.c b/gcc/testsuite/gcc.dg/sancov/pr80444.c
new file mode 100644 (file)
index 0000000..362085d
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR sanitizer/80444 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize-coverage=trace-pc -fcompare-debug" } */
+
+void
+foo (void)
+{
+  int a = 0;
+}