[PATCH v5 0/6] Add support for LoongArch32
Xi Ruoyao
xry111@xry111.site
Tue Mar 3 16:33:26 GMT 2026
On Tue, 2026-03-03 at 19:28 +0800, mengqinggang wrote:
>
> 在 2026/3/3 18:11, Xi Ruoyao 写道:
> > On Tue, 2026-03-03 at 17:54 +0800, mengqinggang wrote:
> > > LoongArch64 gcc generates call memset to fully zero-filling the struct.
> > > But LoongArch32 gcc not generate call memset.
> > > Maybe we can fix LoongArch32 gcc to resolve this problem.
> > This is not a compiler bug so there's nothing to be fixed in the
> > compiler. In C using = {...} to initialize a struct with automatic
> > storage duration will leave the padding bits unspecified, unless the
> > initializer is empty.
> >
> > See https://gcc.gnu.org/PR104607 which has been resolved as invalid
> > years ago.
>
> According to what you said, loongarch64 gcc should not generate call
> memset assembly code?
I don't think it should. This seems a missed-optimization on almost all
GCC ports (GCC r16-7721 actually emits the memset for LA32...)
--
Xi Ruoyao <xry111@xry111.site>
More information about the Libc-alpha
mailing list