> On 30 Oct 2026, at 17.23, Jason Merrill <[email protected]> wrote:
>
> On 10/30/26 7:50 AM, Jonas Hansen via Sourceware Forge wrote:
>> From: Jonas Hansen <[email protected]>
>> The name recorded by .DEFERRED_INIT can stop identifying its destination
>> after inlining or LTO renumbers anonymous declarations. This makes
>> warn_uninit diagnose an artificial initialization store as an
>> uninitialized read, notably with sanitizers and -ftrivial-auto-var-init.
>> Use the initialized declaration's address as diagnostic metadata instead
>> of a name string. Preserve its identity through declaration remapping
>> and LTO streaming, and compare declarations in warn_uninit. Keep this
>> operand unevaluated and avoid making the object addressable or preventing
>> SSA promotion. Update scalar replacement, nested-function lowering,
>> parallelization and offload handling accordingly.
>
> Is the ADDR_EXPR easier to handle than using the DECL directly as the operand?
>
> Jason
>
Hi Jason,
I followed Richard’s earlier preference
(https://www.mail-archive.com/gcc-patches%40gcc.gnu.org/msg423145.html) for IL
hygiene. ADDR_EXPR has one useful property here: SSA operand scanning already
treats &decl as identifying an object without reading its value. A bare
register-type DECL would normally be treated as a value use and renamed into
SSA.
However, the address form still requires special handling to avoid making the
object addressable and to preserve the metadata through transformations. A
direct DECL would instead need explicit handling to prevent value-use
processing.
I haven’t implemented the direct-DECL alternative for comparison, so I can’t
claim the address form is simpler overall.
Jonas