  We describe how to compute for two polynomials $f(X), g(X) \in \mathbb{Z}[X]$
with integer coefficients the greatest common divisors of $f(z)$ and $g(z)$ for
all integers $z \in \mathbb{Z}$. As an application we determine the structures
(elementary divisors) of all maximal tori in exceptional groups of Lie type.
