  We study the regularity of smooth functions $f$ defined on an open set of
$\mathbb{R}^n$ and such that, for certain integers $p\geq 2$, the powers $f^p
:x\mapsto (f(x))^p$ belong to a Denjoy-Carleman class $\mathcal{C}_M$
associated with a suitable weight sequence $M$. Our main result is a statement
analogous to a classic theorem of H. Joris on $\mathcal{C}^\infty$ functions:
if a function $f:\mathbb{R}\to\mathbb{R}$ is such that both functions $f^p$ and
$f^q$ with $\gcd(p,q)=1$ are of class $\mathcal{C}_M$ on $\mathbb{R}$, and if
the weight sequence $M$ satisfies the so-called moderate growth assumption,
then $f$ itself is of class $\mathcal{C}_M$. Various ancillary results,
corollaries and examples are presented.
