S&P 500 nears record as July CPI cools, gold tops $4,400