kdlucas / byte-unixbench

Automatically exported from code.google.com/p/byte-unixbench
GNU General Public License v2.0
1.27k stars 323 forks source link

Can we initialize the global variables? #95

Open huyubiao opened 8 months ago

huyubiao commented 8 months ago

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.)

gstrauss commented 8 months ago

Is there a measurable difference in the performance tests if the global variables are in the .data section or the .bss section?

The latest gcc stable release is gcc 13.2 (https://gcc.gnu.org/releases.html)

huyubiao commented 8 months ago

Is there a measurable difference in the performance tests if the global variables are in the .data section or the .bss section?

The latest gcc stable release is gcc 13.2 (https://gcc.gnu.org/releases.html)