https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113727
Xi Ruoyao <xry111 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=109982 --- Comment #8 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- #pragma pack(push) #pragma pack(1) struct S0 { signed f0 : 22; uint32_t f1; unsigned f2 : 5; unsigned f3 : 21; unsigned f4 : 8; signed f5 : 22; signed f6 : 1; signed f7 : 23; signed f8 : 10; }; #pragma pack(pop) Removing these #pragma silence the UBSan. But I bet the code is just invalid with those #pragma and with #pragma removed the issue will just gone, like PR109982.