Investors are saying goodbye to the U.S. stock market after suffering its worst first-half performance in 50 years, driven by inflation and recession fears.