I believe the answer is "no". The key lemma is:
Lemma. Let $f: [c,d] \to {\bf R}$ be smooth, let $I$ be a compact subinterval of $(c,d)$, $q$ be an interior point of $I$, let $n \geq 1$, and let $\varepsilon > 0$. Then there exists a smooth perturbation $g: [c,d] \to {\bf R}$ of $f$ which agrees with $f$ outside of $I$, is a polynomial on a neighbourhood of $q$ of degree at least $n$, but is not a polynomial on all of $I$, and differs from $f$ by at most $\varepsilon$ in $C^n[c,d]$ norm.
If we apply this lemma iteratively for $n=1,2,\ldots$ with $\varepsilon = \varepsilon_n := 2^{-n}$ and $n=0,1,2,\ldots$, starting with $f_0 = 0$, and setting $q = q_n$ to be the first rational (in some enumeration of the rationals) on which $f_n$ is not locally polynomial, one obtains a sequence $f_1, f_2, f_3,\ldots$ of smooth functions on $[c,d]$ which form a Cauchy sequence in $C^k$ for each $k$, and thus converge in the smooth topology to a limit $f$ which is equal to a polynomial on degree at least $n$ on an interval $I_n$, with the $I_n$ disjoint and covering all the rationals, thus dense in $[c,d]$, giving the claim.
To prove the lemma, recall from the Weierstrass approximation theorem that the polynomials are dence dense in $C^0[c,d]$; integrating this fact repeatedly we see that they are dense in $C^n[c,d]$ as well. So we can approximate $f$ to arbitrary accuracy by a polynomial $h$ in the $C^n$ norm; by a small perturbation one can ensure that $h$ has degree at least $n$. Now using a smooth partition of unity, one can create a merged function $g$ that equals $h$ near $q$ and equals $f$, which can be made arbitrarily close in $C^n$. By modifying $g$ a little bit in $I$ away from $q$ one can ensure that $q$ is not polynomial on all of $I$.
The problem here is superficially similar to that in the previous question http://mathoverflow.net/questions/34059/if-f-is-infinitely-differentiable-then-f-coincides-with-a-polynomial , but the latter has qualitative control at every single point (allowing the powerful Baire category theorem to come into play), whereas here one only has qualitative control on a dense set, which is a far weaker statement, and one which allows for a great deal of flexibility.

