  This paper studies the loss of the semimartingale property of the process
$g(Y)$ at the time a one-dimensional diffusion $Y$ hits a level, where $g$ is a
difference of two convex functions. We show that the process $g(Y)$ can fail to
be a semimartingale in two ways only, which leads to a natural definition of
non-semimartingales of the \textit{first} and \textit{second kind}. We give a
deterministic if and only if condition (in terms of $g$ and the coefficients of
$Y$) for $g(Y)$ to fall into one of the two classes of processes, which yields
a characterisation for the loss of the semimartingale property. A number of
applications of the results in the theory of stochastic processes and real
analysis are given: e.g. we construct an adapted diffusion $Y$ on $[0,\infty)$
and a \emph{predictable} finite stopping time $\zeta$, such that $Y$ is a
semimartingale on the stochastic interval $[0,\zeta)$, continuous at $\zeta$
and constant after $\zeta$, but is \emph{not} a semimartingale on $[0,\infty)$.
