Value investing works over the long run, but there can be periods when the strategy vastly underperforms. Mega-cap tech stocks and other growth stocks have been the star performers over the past few years, leaving value stocks in the dust.

While it's impossible to say exactly when value stocks will make a comeback, investors will want to load up on them before it becomes obvious that growth-at-all-costs is no longer in favor. Five value stocks to consider are IBM (IBM 1.05%), General Motors (GM -0.04%), Ally Financial (ALLY 0.13%), Cisco Systems (CSCO 0.06%), and Hanesbrands (HBI -0.82%).

Puzzle pieces spelling value.

Image source: Getty Images.

IBM

IBM was one of the few big tech stocks that didn't rally hard in 2020. Sales had been slumping for years as the company tried to transform itself, and the pandemic didn't help.

That transformation isn't yet complete, but the company is well positioned to lead the hybrid cloud computing market. The $34 billion acquisition of Red Hat bolstered the cloud business, and the upcoming spinoff of the massive managed infrastructure services business will allow IBM to focus its resources on its best growth opportunities.

Trading for less than 11 times the average analyst estimate for 2021 earnings and sporting a dividend yield over 5%, IBM should appeal to both value investors and dividend investors.

General Motors

There's probably a bubble in electric car stocks. Tesla is trading at a ludicrous valuation, and smaller electric car stocks have surged on sheer euphoria. For investors who don't want to get destroyed when the markets inevitably come to their senses, GM is the electric car stock to own.

GM is investing $27 billion over the next five years in electric and autonomous vehicles, and it plans to launch 30 electric vehicles globally by 2025. The company is still selling plenty of conventional vehicles, particularly trucks and SUVs. GM recently reported that its fourth-quarter sales rose 5% in a tough pandemic market.

With analysts expecting GM to produce earnings of $5.76 per share next year, the stock trades at a paltry price-to-earnings ratio of just over 7. There's no reason to believe the company won't be a leader in electric cars in the long run, and GM's cash-rich balance sheet should allow it to weather whatever economic conditions emerge after the pandemic has passed.

Ally Financial

While Ally has been reducing the rates it offers on its savings accounts to align with the interest rate environment, the bank has had no problem gaining customers. The company gained $5 billion in retail deposits in the third quarter of 2020, its best third-quarter performance ever.

Auto finance is Ally's main line of business, and that business is doing well despite the pandemic. Pre-tax income for the automotive finance segment surged more than 30% year over year in the third quarter, which helped drive adjusted earnings per share up 24%.

Ally's dependence on the auto industry certainly makes the stock riskier than a more diversified bank. But with shares trading for barely more than adjusted tangible book value, Ally deserves a look from value investors.

Cisco Systems

Another tech stock that has been left behind is networking hardware giant Cisco. It depends on large-enterprise and government customers, which tend to pull back on spending when the economic outlook becomes uncertain. The pandemic has led to a downturn in sales for Cisco, but things are now starting to look up.

It expects revenue to drop by 2% at most in the fiscal second quarter, a big improvement from the 9% plunge in the first quarter. The spending pause by customers that Cisco has been experiencing seems to be coming to an end. Demand generally rebounds strongly for Cisco following downturns, and this time will likely be no different.

Cisco stock isn't as cheap as some of the other stocks mentioned here, trading for about 14 times the average analyst estimate for fiscal 2021 earnings. But given that the S&P 500 currently sports a P/E ratio above 35, it's safe to call Cisco a value stock in this overheated market.

Hanesbrands

Weak foot traffic to department stores and apparel retailers hurt sales of innerwear and activewear for Hanesbrands during the pandemic. Luckily, the company was able to pivot to masks and other personal protective gear last year. The situation has started to turn around: U.S. innerwear sales rose 8.4% in the third quarter excluding protective garments. But the activewear business is still suffering steep declines.

Hanesbrands is now undergoing a review as it works out a new long-term strategy. Divesting or spinning off some brands could be part of the plan. The Champion brand is the strongest grower for Hanesbrands; it could make sense to separate it from slower-growing brands like Hanes.

The stock is trading for just 10 times the average analyst estimate for 2021 earnings. While overall growth has been sluggish, the Champion brand is a growth business within the company. Hanesbrands is not an exciting stock, but it could easily double if business rebounds after the pandemic is over, and if management makes some smart strategic moves.