From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id E63A8398B863 for ; Fri, 21 May 2021 12:39:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E63A8398B863 Received: by mail-wr1-x42a.google.com with SMTP id q5so20927176wrs.4 for ; Fri, 21 May 2021 05:39:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=iTLjHIftKI5m66YdTRsSRgtFvvSSoPBkiG3LkEsEL+Q=; b=GdVxqh1WCbC3kkm1JHD590hAHqc5PkOW064O6kfGc9PTt1vZyLE+m/2mA5XN6ChLlf adxhXn2lGxbEzy0KSTgQy5bQZl9HUqCsUv7d/NApIkD1n323syCmnMTf2VDg2io6Erws Uz0yTIVR2t9Sv0/voNCyYuhpX3nrZUVjOWVQtMO/ZbMvqqXn1tiA0jlaN5offlkCWn8p dCv8+Cr5t89v/yV0NAdhw+rU5JY39GLFQE+9SdfNc83Cg+0WtYlwuAOmTUSvZTAa2BkX 3Fi7vemxku6zxBOUNJ/+jdeA3C/15rz71SWu0cykiur60PQjbeG/2yM+mIdAEnq3VX5I ApaA== X-Gm-Message-State: AOAM530+NiJZ2RhmN4MfVjmhcQXf5zSNFQELlnCIC/1yGxqzBQPNKHwk /BdH6zCry2whnYq/jJ8mSiCjWQ== X-Google-Smtp-Source: ABdhPJzGoRVqorpYq8GHz+5d1BoAd4VKzhXvmZKJI21ivVAlXkQu/+chMOZQSEWjU/x5pPbCokGvZw== X-Received: by 2002:a5d:5745:: with SMTP id q5mr9490753wrw.56.1621600776862; Fri, 21 May 2021 05:39:36 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:15:13:a932:cdd6:7230:17ba]) by smtp.gmail.com with ESMTPSA id z5sm2074206wrn.69.2021.05.21.05.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 05:39:36 -0700 (PDT) Date: Fri, 21 May 2021 14:39:30 +0200 From: Marco Elver To: Martin =?utf-8?B?TGnFoWth?= Cc: GCC Patches , Nick Desaulniers Subject: Re: [PATCH] Add no_sanitize_coverage attribute. Message-ID: References: <411ce78b-abcc-59fa-37e7-49471a68b057@suse.cz> <7f0a98b5-1c36-d357-8c5e-bd561f029a48@suse.cz> <7204e2a0-1969-6be5-ec15-7d38b210206d@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7204e2a0-1969-6be5-ec15-7d38b210206d@suse.cz> User-Agent: Mutt/2.0.5 (2021-01-21) X-Spam-Status: No, score=-27.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2021 12:39:39 -0000 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+KjNDzK7hGg@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