Stocks fell on negative sentiment after a White House shooting and geopolitical tensions offset AI optimism, pushing the S&P 500 away from record highs.