Carbonate cements, such as calcite, dolomite, ferrocalcite and ankerite, play important roles in the formation of pores in sandstones: precipitation of carbonate cements modifies pores and inhibits compaction, while dissolution creates secondary pores. This work proposed a precipitation-dissolution model for carbonate cements-CO2-H2O system by means of ion equilibrium concentration ([M2+], M = Ca, Mg, Fe or Mn) with different factors, such as temperature, depth, pH, , variable rock composition and overpressure. Precipitation-dissolution reaction routes were also analyzed by minimization of the total Gibbs free energy (ΔG). Δ[M2+], the variation of [Ca2+], [Fe2+], [Mg2+] or [Mn2+] for every 100 m of burial depths, is used to predict precipitation or dissolution. The calculation results indicate that the increasing temperature results in decrease of equilibrium constant of reactions, while the increasing pressure results in a relatively smaller increase of equilibrium constant; As a result, with increasing burial depth, which brings about increase of both temperature and pressure, carbonate cements dissolve firstly and produces the maximal dissolved amounts, and then precipitation happens with further increasing depth; For example, calcite is dissolving from 0.0 km to 3.0 km with a maximal value of [Ca2+] at depth of 0.8 km, and then precipitates with depth deeper than 3.0 km. Meanwhile, with an increasing CO2 mole fraction in the gaseous phase from 0.1% to 10.0% in carbonate systems, the aqueous concentration of metal ions increases, e.g., dissolved amount of CaFe0.7Mg0.3(CO3)2 increases and reaches maximum of 1.78 mmol·L-1 and 8.26 mmol·L-1 at burial depth of 0.7 km with CO2 mole fraction of 0.1% and 10.0%, respectively. For the influence of overpressure in the calcite system, with overpressure ranging from 36 MPa to 83 MPa, pH reaches a minimum of 6.8 at overpressure of 51 MPa; meanwhile, Δ[Ca2+] increases slightly from -2.24 mmol·L-1 to -2.17 mmol·L-1 and remains negative, indicating it is also a precipitation process at burial depth of 3.9 km where overpressure generated. The method used in this study can be applied in assessing burial precipitation-dissolution processes and predicting possible pores in reservoirs with carbonate cement-water-carbon dioxide.