You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GCC 10, the default option -fcommon is changed to -fno-common, see: PR85678. As a result, the uninitialized non-static global variables are moved from the COMMON block to the .bss. As a result, the performance tested in the same environment but different GCC versions is different.
Can we initialize the global variable to eliminate this difference? (Global variables are also usually recommended to be initialized.)
The text was updated successfully, but these errors were encountered:
I tried to test with dhry_1.c and dhry_2.c in 13.2: when using -fno-common the performance is around 9200, but with -fcommon the performance is above 9500. After the global non-static variables in dhry_1.c are initialized and -fcommon is used, the performance returns to 9200. On gcc 10.3 the difference in performance is sometimes greater than 10%.
By the way: I was using Intel Sapphire Rapids when it comes to the CPU architecture. This problem may not exist on other architectures.
I mean, is it possible to unify here: 1. Initialize global non-static variables; 2. Explicitly use -fno-common during compilation.
In GCC 10, the default option -fcommon is changed to -fno-common, see: PR85678. As a result, the uninitialized non-static global variables are moved from the COMMON block to the .bss. As a result, the performance tested in the same environment but different GCC versions is different.
Can we initialize the global variable to eliminate this difference? (Global variables are also usually recommended to be initialized.)
The text was updated successfully, but these errors were encountered: