[PATCH v5 0/6] Add support for LoongArch32

Xi Ruoyao xry111@xry111.site
Wed Mar 11 05:10:47 GMT 2026


On Wed, 2026-03-04 at 16:41 +0800, mengqinggang wrote:
> > If wordsize is 64, there is an int __pad0.
> > Maybe this difference causes the loongarch64 gcc to generate call
> > memset,
> > while the loongarch32 gcc does not.
> 
> 
> On 32 bit target, gcc believes all fields have been initialized. So
> gcc 
> dose not generate call memset.

This is not true.  The C standard does not require to initialize all the
fields in this case, so gcc do not need to generate the memset call no
matter if someone has initialized those fields.

GCC generate the memset call on LA64 is just a bug, I've reported it as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124356.

> Currently, I think  add a memset call in source code is a good idea.

-- 
Xi Ruoyao <xry111@xry111.site>


More information about the Libc-alpha mailing list