PepsiCo reported stronger-than-expected revenue in the second quarter despite weaker demand in North America, where it said consumers tightened their budgets as the Iran war caused gas prices to spike.

"I think the consumer is worse than what we had anticipated, and it's driven mainly by gas prices," PepsiCo CEO Ramon Laguarta said Thursday during a conference call with investors.

PepsiCo's shares fell 4% in morning trading Thursday.