https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114532
Bug ID: 114532 Summary: gcc -fno-common option causes performance degradation on certain architectures Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: h13958451065 at 163 dot com Target Milestone: --- gcc 10.3 has turnd off -fcommon into fno-common by default, which led to performance decrease about 7% (CPU intel sapphire rapids) on UnixBench dhry2reg subtest. We found that L1-dcache-load-misses increased under -fno-common option than -fcommon, which we suspect is the cause of the performance decrease. L1 dcache size is 48K per core in CPU intel sapphire rapids (32 KB instruction + 48 KB data). We have compared the binary layout of the executables generated under -fcommon and -fno-common, we found that the location offset of XXX_Time and XXX_Glob global variables in BSS section increased about 10K under -fno-common. Maybe the increase of bss gap influence the probability of L1-dcache-load-miss. I am not sure about this conclusion, is there any way to verify our conjecture?