partially revert a7849eea due to GCC performance issues