Use external counter for gas (external linkage global variable)

[#79942174]