The stock market was fairly quiet on Tuesday, with major benchmarks staying relatively close to where they began the session. Investors largely seemed to take a break as they wait for further guidance on key issues, including the geopolitical situations with North Korea and key U.S. trading allies, who are still reeling from tariff threats. In addition, the meeting of the Federal Reserve later this month should shed some light on the central bank's future course of monetary policy. Even in a calm market, some stocks managed to post substantial gains. Twitter (NYSE:TWTR), Gap (NYSE:GPS), and Macy's (NYSE:M) were among the best performers on the day. Here's why they did so well.

Twitter prepares to join the S&P 500

Shares of Twitter gained 5% as indexing managers S&P Dow Jones Indices announced that the social media giant would become part of the S&P 500 index. Twitter will take the place of Monsanto, which the index manager expects will finally get acquired by Germany's Bayer. With a $30 billion market cap, Twitter was too big to have been admitted into smaller S&P indexes, but even though some market watchers had suggested that the social media giant deserved a spot in the premier S&P 500 as early as 2013 shortly after its IPO, S&P Dow Jones has rules governing when it will consider newly public companies. Some skeptics note that similar inclusions of high-flying tech stocks in the late 1990s turned out to be poorly timed, but Twitter followers can respond that criticism of Facebook's inclusion in late 2013 proved to be dead wrong.

Blue Twitter bird logo.

Image source: Twitter.

Gap bounces back

Gap stock climbed 7% on a good day for retail generally. The clothing specialist had seen its shares fall dramatically late last month after it reported relatively weak results for its first quarter, including just a 1% rise in comparable sales and declines in gross margin figures due to inventory-related struggles. Yet even at the time, Gap CEO Art Peck was pleased at how well the company overcame challenges. Today's gains reflect the recognition that the retailer has high expectations for the remainder of the year, and success elsewhere in the industry suggests that the retail environment overall is improving. That should help premium names like Gap claw back lost ground as well.

Macy's maintains momentum

Finally, shares of Macy's picked up 8%. The department store retailer built on gains from Monday, when analysts at Evercore ISI changed their views on Macy's from bearish to bullish. Evercore pointed to better engagement with its customers through a combination of strategies ranging from generating buzz on social media to making key changes to its loyalty program. With a call for the end of what it dubbed the "retailpocalypse," the analysts brightened investors' outlook for the entire retail industry, and Macy's has the capacity to be one of the big winners if customers come back to the mall to shop in earnest.

Dan Caplinger has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Facebook and Twitter. The Motley Fool has a disclosure policy.