Tundra Stalling Woes

I have a 2000 Toyota Tundra extra cab with a 4.7L V-8 w/ auto trans. Occasionally the engine stalls when shifting gears. It happens when shifting from P to R, R to P, D to R, P to D, etc. It does it when the engine is cold or hot. Most of the time it happens after the truck has been driven and I stop and shift to a different gear. It happens on the flat or hills. Anyone have any theories?