v7.4-rc2 kernel build failure when using the upstream LLVM 24 with -Wunsequenced-volatile
From: Yunseong Kim
Date: Thu Nov 19 2026 - 08:24:26 EST
Hi,
After https://github.com/llvm/llvm-project/pull/180955 feature
"[clang] Add check in SemaChecking for multiple unsequenced volatile accesses",
v7.4-rc2 kernel compiling with the upstream LLVM 24 was failed.
kernel/sched/build_utility.c:86:
kernel/sched/topology.c:2008:29: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced-volatile]
1998 | .last_balance = jiffies,
| ~~~~~~~
1999 | .balance_interval = sd_weight,
2000 |
2001 | /* 50% success rate */
2002 | .newidle_call = 512,
2003 | .newidle_success = 256,
2004 | .newidle_ratio = 512,
2005 | .newidle_stamp = now,
2006 |
2007 | .max_newidle_lb_cost = 0,
2008 | .last_decay_max_lb_cost = jiffies,
| ^
1 error generated.
Is that mean topology code have a potential issue, or is this a compiler's
false positive? The same error message can be reproduced on the example
user space program.
$ cat jiffies.c
extern volatile unsigned long jiffies;
struct sample {
unsigned long a;
unsigned long b;
};
void init(struct sample *p)
{
*p = (struct sample) {
.a = jiffies,
.b = jiffies,
};
}
$ clang --version --verbose
clang version 24.0.0git (https://github.com/yskzalloc/llvm-project.git 5d20c85f4e1b8755b655bf1782b094fb35ec48d1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/debian-sid/kcov-dataflow/llvm-project/build-upstream-check/bin
$ clang -std=gnu11 -Werror=unsequenced-volatile -fsyntax-only jiffies.c
jiffies.c:12:14: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced-volatile]
11 | .a = jiffies,
| ~~~~~~~
12 | .b = jiffies,
| ^
1 error generated.
Thanks!
Best regards,
Yunseong