Re: [PATCH 08/10] gpu: nova-core: use projection for PFALCON and PFALCON2 registers

From: Miguel Ojeda

Date: Tue Jul 28 2026 - 15:38:17 EST


On Tue, Jul 28, 2026 at 9:03 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> It'd be a compiler bug if const folding is expected to happen, the whole
> BUILD_BUG_ON depends on it working.
>
> `build_assert!` is a useful tool that I'm not giving up. If there is a need to
> use it, then I'd use it compared to having two variants to do the same thing
> with different syntax.

Yeah, and on this topic, the overall concept is being discussed in the
C standard committee due to paper:

N3846 2026/03/10 Grant, compile_assert – optimization-enforced
conditions at compile time
https://www.open-std.org/jtc1/sc22/WG14/www/docs/n3846.pdf

I gave the author some feedback on the prior art in Linux (at least
since 2002, originally using the linker approach) and GCC (adding the
compiler attribute in 2007 from what I could see), including our Rust
macro too, starting in 2022.

Hopefully the discussion will continue -- the thread was active up to
a few days ago.

Cheers,
Miguel