fix creg compile error for gcc