Let $$ f(x) = \sum_{j=1}^n c_j e^{2\pi i\alpha_j x}, g(x) = \sum_{k=1}^m d_k e^{2\pi i\beta_k x}$$ be two (quasi-periodic) trigonometric polynomials, where the coefficients $c_j, d_k$ are complex and the frequencies $\alpha_j,\beta_k$ are real (but are not necessarily commensurable). Suppose that $f,g$ have infinitely many zeroes in common, thus $f(x)=g(x)=0$ for infinitely many reals $x$. Does this imply that $f,g$ have a non-trivial common factor (in the ring of trigonometric polynomials)? In the commensurable case (so that $f,g$ have a common period) this is clear from the factor theorem, but my interest is in the incommensurable case. I would also be interested in the special case when $f,g$ are both real-valued, though I suspect that this restriction does not materially impact the question.
Here is a closely related question. Let $G = \{ (e^{2\pi i \alpha_1 x}, \dots, e^{2\pi i \alpha_k x}): x \in {\bf R} \}$ be a one-parameter subgroup of the torus $(S^1)^k$ for some reals $\alpha_1,\dots,\alpha_k$ that are linearly independent over ${\bf Q}$ (so that $G$ is dense in $(S^1)^k$). Is it true that every codimension two real subvariety of $(S^1)^k$ intersects $G$ in at most finitely many points? Note that if one specialises to the subvarieties $\{ z \in (S^1)^k: P(z)=Q(z)=0\}$ for two polynomials $P,Q$ with no common factor one basically obtains a version of the first question.
I'm somewhat aware of the literature on exponential polynomials (e.g., Ritt's theorem), but I couldn't find quite the appropriate tool; results in transcendental number theory (e.g., the six exponentials theorem) also seem vaguely relevant, but again it's not quite a perfect fit.