The impacts of historical droughts and heat-waves on ecosystems are often considered indicative of future global warming impacts, under the assumption that water stress sets in above a fixed high temperature threshold. Historical and future (RCP8.5) Earth system model (ESM) climate projections were analyzed in this study to illustrate changes in the temperatures for onset of water stress under global warming. The ESMs examined here predict sharp declines in gross primary production (GPP) at warm temperature extremes in historical climates, similar to the observed correlations between GPP and temperature during historical heat-waves and droughts. However, soil moisture increases at the warm end of the temperature range, and the temperature at which soil moisture declines with temperature shifts to a higher temperature. The temperature for onset of water stress thus increases under global warming and is associated with a shift in the temperature for maximum GPP to warmer temperatures. Despite the shift in this local temperature optimum, the impacts of warm extremes on GPP are approximately invariant when extremes are defined relative to the optimal temperature within each climate period. The GPP sensitivity to these relative temperature extremes therefore remains similar between future and present climates, suggesting that the heat- and drought-induced GPP reductions seen recently can be expected to be similar in the future, and may be underestimates of future impacts given model projections of increased frequency and persistence of heat-waves and droughts. The local temperature optimum can be understood as the temperature at which the combination of water stress and light limitations is minimized, and this concept gives insights into how GPP responds to climate extremes in both historical and future climate periods. Both cold (temperature and light-limited) and warm (water-limited) relative temperature extremes become more persistent in future climate projections, and the time taken to return to locally optimal climates for GPP following climate extremes increases by more than 25% over many land regions.