The stock market is generally expected to benefit from inflation, but surging price pressures are rattling investors.