https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116961
Bug ID: 116961 Summary: Valgrind reports uninitialized memory use in dstruct.d (dmd.dstruct._isZeroInit(dmd.expression.Expression) Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: build Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: sjames at gcc dot gnu.org Target Milestone: --- When bootstrapping with some patches for improving Valgrind support (see PR116947), I hit this: ``` /bin/sh ../libtool --tag=D --mode=compile /tmp/build/./gcc/gdc -B/tmp/build/./gcc/ -B/tmp/gcc/x86_64-pc-linux-gnu/bin/ -B/tmp/gcc/x86_64-pc-linux-gnu/lib/ -isystem /tmp/gcc/x86_64-pc-linux-gnu/include -isystem /tmp/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -prefer-pic -fversion=Shared -Wall -frelease -ffunction-sections -fdata-sections -O2 -g -fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields -nostdinc -I /home/sam/git/gcc/libphobos/libdruntime -I . -c -o core/internal/gc/impl/manual/gc.lo /home/sam/git/gcc/libphobos/libdruntime/core/internal/gc/impl/manual/gc.d /bin/sh ../libtool --tag=D --mode=compile /tmp/build/./gcc/gdc -B/tmp/build/./gcc/ -B/tmp/gcc/x86_64-pc-linux-gnu/bin/ -B/tmp/gcc/x86_64-pc-linux-gnu/lib/ -isystem /tmp/gcc/x86_64-pc-linux-gnu/include -isystem /tmp/gcc/x86_64-pc-linux-gnu/sys-include -fno-checking -prefer-pic -fversion=Shared -Wall -frelease -ffunction-sections -fdata-sections -O2 -g -fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields -nostdinc -I /home/sam/git/gcc/libphobos/libdruntime -I . -c -o core/internal/gc/impl/proto/gc.lo /home/sam/git/gcc/libphobos/libdruntime/core/internal/gc/impl/proto/gc.d [...] ==26778== Conditional jump or move depends on uninitialised value(s) ==26778== at 0x911F41: dmd.dstruct._isZeroInit(dmd.expression.Expression) (dstruct.d:635) ==26778== by 0x9123BE: StructDeclaration::finalizeSize() (dstruct.d:373) ==26778== by 0x86747C: dmd.aggregate.AggregateDeclaration.determineSize(ref const(dmd.location.Loc)) (aggregate.d:226) ==26778== by 0xA052C7: TypeStruct::isAssignable() (mtype.d:3904) ==26778== by 0x888D6D: dmd.clone.buildOpAssign(dmd.dstruct.StructDeclaration, dmd.dscope.Scope*) (clone.d:293) ==26778== by 0x91D1DF: DsymbolSemanticVisitor::visit(StructDeclaration*) (dsymbolsem.d:2994) ==26778== by 0x915901: dsymbolSemantic (dsymbolsem.d:91) ==26778== by 0x915901: dmd.dsymbolsem.DsymbolSemanticVisitor.visit(dmd.dmodule.Module).__lambda3!(dmd.dsymbol.Dsymbol).__lambda3(dmd.dsymbol.Dsymbol) (dsymbolsem.d:1948) ==26778== by 0x913447: dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*, scope void(dmd.dsymbol.Dsymbol) delegate) (dsymbol.d:104) ==26778== by 0x91596F: DsymbolSemanticVisitor::visit(Module*) (dsymbolsem.d:1945) ==26778== by 0x919639: dmd.dsymbolsem.dsymbolSemantic(dmd.dsymbol.Dsymbol, dmd.dscope.Scope*) (dsymbolsem.d:91) ==26778== by 0xADCB59: d_parse_file() (d-lang.cc:1250) ==26778== by 0x105988E: compile_file() (toplev.cc:452) ==26778== Uninitialised value was created by a stack allocation ==26778== at 0x9FE860: dmd.lexer.Lexer.number(dmd.tokens.Token*) (lexer.d:2215) ==26778== make[5]: *** [Makefile:2581: core/internal/gc/impl/conservative/gc.lo] Error 1 make[5]: *** Waiting for unfinished jobs.... make[5]: Leaving directory '/tmp/build/x86_64-pc-linux-gnu/libphobos/libdruntime' make[4]: *** [Makefile:485: all-recursive] Error 1 make[4]: Leaving directory '/tmp/build/x86_64-pc-linux-gnu/libphobos' make[3]: *** [Makefile:412: all] Error 2 make[3]: Leaving directory '/tmp/build/x86_64-pc-linux-gnu/libphobos' make[2]: *** [Makefile:24145: all-stage1-target-libphobos] Error 2 make[2]: *** Waiting for unfinished jobs.... ```