On Fri, May 21, 2021 at 10:50AM +0200, Martin Liška wrote:
> On 5/20/21 12:55 PM, Marco Elver wrote:
> > I think this came up with other no_sanitize [1] based on what I had
> > written to you last year [2].
> > 
> > [1]https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547618.html
> > [2]https://lore.kernel.org/lkml/canpmjnnrz5ovkb6pe7k6gjfogbht_zhypkng9ad+kjndzk7...@mail.gmail.com/
> 
> Ah, you're right. I've just updated the patch to address that.
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?

Looks good, I also just built a kernel with the no_sanitize_coverage
attribute (without the objtool nop-workaround) and works as expected.

Not sure if required, but would such an additional test be useful:

---

diff --git a/gcc/testsuite/gcc.dg/sancov/attribute.c 
b/gcc/testsuite/gcc.dg/sancov/attribute.c
index bf6dbd4bae7..7cfa9134ff1 100644
--- a/gcc/testsuite/gcc.dg/sancov/attribute.c
+++ b/gcc/testsuite/gcc.dg/sancov/attribute.c
@@ -11,5 +11,17 @@ bar(void)
 {
 }
 
+static void inline
+__attribute__((always_inline))
+inline_fn(void)
+{
+}
+
+void
+__attribute__((no_sanitize_coverage))
+baz(void)
+{
+  inline_fn();
+}
 
 /* { dg-final { scan-tree-dump-times "__builtin___sanitizer_cov_trace_pc 
\\(\\)" 1 "optimized" } } */

---

Otherwise, please go ahead. I assume this is targeting GCC 12?

Thanks,
-- Marco

Reply via email to