[RMG]Fix gcc build, remove some unused variables