mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* v7.4-rc2 kernel build failure when using the upstream LLVM 24 with -Wunsequenced-volatile
@ 2026-11-19 13:23 Yunseong Kim
  2026-11-19 14:13 ` Yunseong Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Yunseong Kim @ 2026-11-19 13:23 UTC (permalink / raw)
  To: aaron.ballman, Nathan Chancellor, Nick Desaulniers,
	Bill Wendling, Justin Stitt, Nicolas Schier, Ingo Molnar,
	Peter Zijlstra, Juri Lelli, Vincent Guittot, Steven Rostedt,
	Ben Segall, Mel Gorman, Valentin Schneider
  Cc: llvm, linux-kbuild, linux-kernel, thakis

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 13:23 v7.4-rc2 kernel build failure when using the upstream LLVM 24 with -Wunsequenced-volatile Yunseong Kim
2026-11-19 14:13 ` Yunseong Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®