  We characterize Product-MDS pairs of linear codes, i.e.\ pairs of codes $C,D$
whose product under coordinatewise multiplication has maximum possible minimum
distance as a function of the code length and the dimensions $\dim C, \dim D$.
We prove in particular, for $C=D$, that if the square of the code $C$ has
minimum distance at least $2$, and $(C,C)$ is a Product-MDS pair, then either
$C$ is a generalized Reed-Solomon code, or $C$ is a direct sum of self-dual
codes. In passing we establish coding-theory analogues of classical theorems of
additive combinatorics.
