Each smooth elliptic Calabi-Yau 4-fold determines both a three-dimensional physical theory (a compactification of “M-theory”) and a four-dimensional physical theory (using the “F-theory” construction). A key issue in both theories is the calculation of the “superpotential” of the theory, which by a result of Witten is determined by the divisors D on the 4-fold satisfying X( O D = 1. We propose a systematic approach to identify these divisors, and derive some criteria to determine whether a given divisor indeed contributes. We then apply our techniques in explicit examples, in particular, when the base B of the elliptic fibration is a toric variety or a Fano 3-fold. When B is Fano, we show how divisors contributing to the superpotential are always “exceptional” (in some sense) for the Calabi-Yau 4-fold X. This naturally leads to certain transitions of X, i.e., birational tranformations to a singular model (where the image of D no longer contributes) as well as certain smoothings of the singular model. The singularities which occur are “canonical”, the same type of singularities of a (singular) Weierstrass model. We work out the transitions. If a smoothing exists, then the Hodge numbers change. We speculate that divisors contributing to the superpotential are always “exceptional” (in some sense) for X, also in M-theory. In fact we show that this is a consequence of the (log)-minimal model algorithm in dimension 4, which is still conjectural in its generality, but it has been worked out in various cases, among which are toric varieties.