  Context. Solar gravity modes (g modes) are buoyancy waves trapped in the
solar radiative zone that have been very difficult to detect at the surface.
Solar g modes would complement solar pressure modes (p modes) in probing the
central regions of the Sun, for example the core rotation rate.
  Aims. A detection of g modes using changes in the large frequency separation
of p modes has recently been reported. However, it is unclear how p and g modes
interact. The aim of this study is to evaluate to what extent g modes can
perturb the frequencies of p modes.
  Methods. We computed the first-order perturbation to global p-mode
frequencies due to a flow field and perturbations to solar structure caused by
a g mode. We focused on long-period g modes and assumed that the g-mode
perturbations are constant in time. The surface amplitude of g modes is assumed
to be $1$ mm s$^{-1}$, which is close to the observational limit.
  Results. Gravity modes do perturb p-mode frequencies to first order if the
harmonic degree of the g mode is even and if its azimuthal order is zero. The
effect is extremely small. For dipole and quadrupole p modes, all frequency
shifts are smaller than $0.1$ nHz, or $2\times10^{-8}$ in relative numbers.
This is because the relative perturbation to solar structure quantities caused
by a g mode of realistic amplitude is of the order of $10^{-6}$ to $10^{-5}$.
We find that structural changes dominate over advection. Surprisingly, the
interaction of g and p modes takes place to a large part near the surface,
where p modes spend most of their propagation times and g modes generate the
largest relative changes to solar structure.
  Conclusions. It appears to be impossible to detect g modes solely through
their signature in p-mode frequency shifts. Whether g modes leave a detectable
signature in p-mode travel times under a given observational setup remains an
open question.
