From: Jakub Jelinek Date: Tue, 18 Apr 2017 15:02:06 +0000 (+0200) Subject: re PR sanitizer/80444 (-fcompare-debug failures with -fsanitize-coverage=trace-pc) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b5fb3cb5b3831765df93691f6a452c478985366;p=gcc.git re PR sanitizer/80444 (-fcompare-debug failures with -fsanitize-coverage=trace-pc) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8da35cc67e3..07b3384677f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-04-18 Jakub Jelinek + + PR sanitizer/80444 + * sancov.c (sancov_pass): Use gsi_start_nondebug_after_labels_bb + instead of gsi_after_labels. + 2017-04-18 Jeff Law * regcprop.c (maybe_mode_change): Avoid creating copies of the diff --git a/gcc/sancov.c b/gcc/sancov.c index b4d5cc58e7e..1651989ea24 100644 --- a/gcc/sancov.c +++ b/gcc/sancov.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 728f2cfb600..4d1cd159d15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-04-18 Jakub Jelinek + 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 index 00000000000..362085d0178 --- /dev/null +++ b/gcc/testsuite/gcc.dg/sancov/pr80444.c @@ -0,0 +1,9 @@ +/* PR sanitizer/80444 */ +/* { dg-do compile } */ +/* { dg-options "-fsanitize-coverage=trace-pc -fcompare-debug" } */ + +void +foo (void) +{ + int a = 0; +}