Lots of people buy a year's worth of food with expiration dates just beyond one year, and then every year they donate the whole supply to a local food bank or homeless shelter before the expiration dates, and re-purchase everything. For staples though, you can get a ton of calories out of dry goods that can be stored for years if properly packaged.
Beans, rice, other items. Don't forget the stuff you ADD to the main ingredients though, otherwise you end up with a lot of flat bread and tasteless oatmeal

Spices can last a while if vacuum packed and stored cool/dry. Don't rely on anything that needs freezing of course, because if you need those supplies the first thing that won't work is the freezer (duh).
As a hedge against simple food price increases however, I don't think there is much to gain by stockpiling food. The cost of buying/storing and rotating out stuff before it goes bad will come pretty close to eliminating any price difference.
The only thing that can help with food prices is to plant a big enough garden to supply yourself with foods that are expensive to bring to market but can be easily grown at home. A bunch of vegetables and a smallish greenhouse can keep you eating fresh veggies to supplement your diet all year. Even better than that, find a local food co-op and buy in. Some you join by paying, some you join by simply growing whatever it is the co-op as a group decides it needs more of. I've read of some food co-ops in New York (for example) that get you a grocery sack (cloth of course) full of fresh veggies and fruits every week, often delivered by a child of the farmers, for about the same price as going to the store to get it yourself. The drawback is you don't get to choose, but the benefit is that you get 100% preservative free foods which very often taste much better than what you find in the store.
So... If you just want emergency foods, yea there are lots of painless ways to do that. But if you want to hedge against food price increases, plant a garden and find a co-op to join.