S&P dips, just off record as energy shares fall