Re: [PATCH v3 02/35] compiler-capability-analysis: Add infrastructure for Clang's capability analysis

From: Bart Van Assche

Date: Thu Sep 18 2025 - 12:04:09 EST


On 9/18/25 8:58 AM, Ian Rogers wrote:
On Thu, Sep 18, 2025 at 7:05 AM Marco Elver <elver@xxxxxxxxxx> wrote:
+config WARN_CAPABILITY_ANALYSIS
+ bool "Compiler capability-analysis warnings"
+ depends on CC_IS_CLANG && CLANG_VERSION >= 220000
+ # Branch profiling re-defines "if", which messes with the compiler's
+ # ability to analyze __cond_acquires(..), resulting in false positives.
+ depends on !TRACE_BRANCH_PROFILING

Err, wow! What and huh, and why? Crikes. I'm amazed you found such an
option exists. I must be very naive to have never heard of it and now
I wonder if it is needed and load bearing?

(+Steven)

This is an old option. I think this commit introduced it:

commit 52f232cb720a7babb752849cbc2cab2d24021209
Author: Steven Rostedt <rostedt@xxxxxxxxxxx>
Date: Wed Nov 12 00:14:40 2008 -0500

tracing: likely/unlikely branch annotation tracer

Bart.