On Tue, Jul 14, 2026 at 4:29 PM Nazar Kazakov via Gcc <[email protected]> wrote: > > Hello, > > I'm debugging a non-reproducible build of glslang where gcc sometimes > generates > different DWARF debug info even though the code is the same. Is there a > known > bug causing this or is there an easy way to debug this?
Is this happening in a build without -flto? If so then I'd suggest to isolate the TU having the issue. You can also try to see whether -fcompare-debug catches any issue (though in principle that's somewhat an unrelated class of problems). You can see whether disabling address-space randomization helps (it would still be a GCC bug). Once you have a reproducer (preprocessed source) please file a bugreport. Richard. > The non-reproducibility is present in .debug_loclists section, where > some > entries in some loclists have slightly different start and end value, or > different values themselves. > > Example of different start and end values: > 000000000015c06d 000000000015c074 (DW_OP_reg4 (rsi)) > 000000000015c074 000000000015c0b3 (DW_OP_entry_value: (DW_OP_reg4 > (rsi)); DW_OP_stack_value) > vs > 000000000015c06d 000000000015c08f (DW_OP_reg4 (rsi)) > 000000000015c08f 000000000015c0b3 (DW_OP_entry_value: (DW_OP_reg4 > (rsi)); DW_OP_stack_value) > > Example of different values themselves: > 000000000021ea3b 000000000021ea3d (DW_OP_breg0 (rax): -48; > DW_OP_stack_value) > vs > 000000000021ea3b 000000000021ea3d (DW_OP_entry_value: (DW_OP_reg5 > (rdi)); DW_OP_stack_value) > > Full example of the difference can be seen here > https://freedesktop-sdk.gitlab.io/-/freedesktop-sdk/-/jobs/15160251956/artifacts/result_folder/components/glslang.bst/index.html. > > I'm trying to read gcc code to understand how the debug info is > generated, > but it's not an easy read, so I thought I'd ask in here in case it's a > known > issue. > > Thank you, > Nazar Kazakov
