S&P 500 near record as credit warning hits 2007 high